Advertisement
subaru112g

moving dummy script

Jan 13th, 2019
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.52 KB | None | 0 0
  1. local plr = owner
  2. wait(0.1)
  3.  
  4. local m = Instance.new("Model", game.Workspace)
  5. m.Name = owner.Character.Name.. "'s Moving Dummy"
  6.  
  7. local h = Instance.new("Part",m)
  8. h.Name = "Head"
  9. local me = plr.Character.Head.Mesh:Clone()
  10. me.Parent = h
  11. local facee = plr.Character.Head.face:Clone()
  12. facee.Parent = h
  13. h.Size = plr.Character.Head.Size
  14. h:BreakJoints()
  15. h.CanCollide = false
  16. h.Position = plr.Character.Head.Position
  17. h.Position = h.Position + Vector3.new(0, 10, 0)
  18. h.face.Texture = "http://www.roblox.com/asset/?id=15199999"
  19.  
  20. local t = Instance.new("Part",m)
  21. t.Name = "Torso"
  22. t.Size = plr.Character.Torso.Size
  23. t:BreakJoints()
  24. t.CanCollide = false
  25. t.Position = plr.Character.Torso.Position
  26. t.Position = t.Position + Vector3.new(0, 10, 0)
  27.  
  28. local ra = Instance.new("Part",m)
  29. ra.Name = "Right Arm"
  30. ra.Size = plr.Character["Right Arm"].Size
  31. ra:BreakJoints()
  32. ra.Position = plr.Character["Right Arm"].Position
  33. ra.Position = ra.Position + Vector3.new(0, 10, 0)
  34.  
  35. local la = Instance.new("Part",m)
  36. la.Name = "Left Arm"
  37. la.Size = plr.Character["Left Arm"].Size
  38. la:BreakJoints()
  39. la.Position = plr.Character["Left Arm"].Position
  40. la.Position = la.Position + Vector3.new(0, 10, 0)
  41.  
  42. local ll = Instance.new("Part",m)
  43. ll.Name = "Left Leg"
  44. ll.Size = plr.Character["Left Leg"].Size
  45. ll:BreakJoints()
  46. ll.Position = plr.Character["Left Leg"].Position
  47. ll.Position = ll.Position + Vector3.new(0, 10, 0)
  48.  
  49. local rl = Instance.new("Part",m)
  50. rl.Name = "Right Leg"
  51. rl.Size = plr.Character["Right Leg"].Size
  52. rl:BreakJoints()
  53. rl.Position = plr.Character["Right Leg"].Position
  54. rl.Position = rl.Position + Vector3.new(0, 10, 0)
  55.  
  56. for i,v in pairs(m:GetChildren()) do
  57. v:BreakJoints()
  58. end
  59.  
  60. local neck = Instance.new("Motor6D")
  61. neck.Name = "Neck"
  62. neck.Part0 = t
  63. neck.Part1 = h
  64. neck.Parent = t
  65. neck.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  66. neck.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  67.  
  68. local rs = Instance.new("Motor6D")
  69. rs.Name = "Right Shoulder"
  70. rs.Part0 = t
  71. rs.Part1 = ra
  72. rs.Parent = t
  73. rs.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  74. rs.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  75.  
  76. local ls = Instance.new("Motor6D")
  77. ls.Name = "Left Shoulder"
  78. ls.Part0 = t
  79. ls.Part1 = la
  80. ls.Parent = t
  81. ls.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  82. ls.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  83.  
  84. local lh = Instance.new("Motor6D")
  85. lh.Name = "Left Hip"
  86. lh.Part0 = t
  87. lh.Part1 = ll
  88. lh.Parent = t
  89. lh.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  90. lh.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  91.  
  92. local rh = Instance.new("Motor6D")
  93. rh.Name = "Right Hip"
  94. rh.Part0 = t
  95. rh.Part1 = rl
  96. rh.Parent = t
  97. rh.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  98. rh.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  99.  
  100. wait(0.000000000000001)
  101.  
  102. local hu = Instance.new("Humanoid", m)
  103. hu.MaxHealth = 100
  104. hu.Health = 100
  105. hu.WalkSpeed = 13
  106.  
  107. h.BrickColor = BrickColor.new("Br. yellowish green")
  108. ra.BrickColor = BrickColor.new("Br. yellowish green")
  109. la.BrickColor = BrickColor.new("Br. yellowish green")
  110. t.BrickColor = BrickColor.new("New Yeller")
  111. rl.BrickColor = BrickColor.new("New Yeller")
  112. ll.BrickColor = BrickColor.new("New Yeller")
  113.  
  114. local animation = Instance.new("Animation", script)
  115. animation.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  116.  
  117. local hum = m:WaitForChild("Humanoid")
  118. local anim = hum:LoadAnimation(script:FindFirstChildOfClass("Animation"))
  119. anim.Looped = true
  120. anim:Play()
  121.  
  122. local CurrentPart = nil
  123. local MaxInc = 30
  124.  
  125. function onTouched(hit)
  126. if hit.Parent == nil then
  127. return
  128. end
  129.  
  130. local humanoid = hit.Parent:findFirstChild("Humanoid")
  131.  
  132. if humanoid == nil then
  133. CurrentPart = hit
  134. end
  135. end
  136.  
  137. function waitForChild(parent, childName)
  138. local child = parent:findFirstChild(childName)
  139.  
  140. if child then
  141. return child
  142. end
  143.  
  144. while true do
  145. print(childName)
  146.  
  147. child = parent.ChildAdded:wait()
  148.  
  149. if child.Name==childName then
  150. return child
  151. end
  152. end
  153. end
  154.  
  155. local Figure = m
  156. local Humanoid = waitForChild(Figure, "Humanoid")
  157. local Torso = waitForChild(Figure, "Torso")
  158. local Left = waitForChild(Figure, "Left Leg")
  159. local Right = waitForChild(Figure, "Right Leg")
  160.  
  161. Humanoid.Jump = true
  162.  
  163. Left.Touched:connect(onTouched)
  164. Right.Touched:connect(onTouched)
  165.  
  166. while true do
  167. wait(0.5)
  168. if CurrentPart ~= nil then
  169. if math.random(5, 7) == 1 then
  170. Humanoid.Jump = true
  171. end
  172.  
  173. Humanoid:MoveTo(Torso.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)), CurrentPart)
  174. end
  175. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement