Advertisement
subaru112g

hostile dummy

Jan 20th, 2019
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.81 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 Hostile 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("Really red")
  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. while true do
  123. wait()
  124. for i,v in pairs(workspace:GetChildren()) do
  125. if v.Name == owner.Character.Name.."'s hostile dummy" then
  126. m = v
  127. function onTouched(fire)
  128. local humn = fire.Parent:FindFirstChild("Humanoid")
  129. if humn then
  130. for i,v in pairs (humn.Parent:GetChildren()) do
  131. if v.ClassName == "Part" then
  132. humn:TakeDamage(0.1)
  133. end
  134. end
  135. end
  136. end
  137. v:FindFirstChild("Torso").Touched:connect(onTouched)
  138.  
  139. s = v
  140. local larm = s:FindFirstChild("Left Arm")
  141. local rarm = s:FindFirstChild("Right Arm")
  142.  
  143. function findNearestTorso(pos)
  144. local list = game.Workspace:children()
  145. local torso = nil
  146. local dist = 100000000000000000000000000000000000000000
  147. local temp = nil
  148. local human = nil
  149. local temp2 = nil
  150. for x = 1, #list do
  151. temp2 = list[x]
  152. if (temp2.className == "Model") and (temp2 ~= s) then
  153. temp = temp2:FindFirstChild("Torso")
  154. h = temp2:FindFirstChild("Humanoid")
  155. if (temp ~= nil) and (h ~= nil) and (h.Health > 0) then
  156. s.Humanoid.WalkSpeed = 10
  157. if (temp.Position - pos).magnitude < dist then
  158. torso = temp
  159. dist = (temp.Position - pos).magnitude
  160. end
  161. end
  162. end
  163. end
  164. return torso
  165. end
  166.  
  167. while true do
  168. local antibug = s:FindFirstChild("Torso")
  169. if antibug ~= nil then
  170. local target = findNearestTorso(antibug.Position)
  171. if target ~= nil then
  172. s.Humanoid:MoveTo(target.Position, target)
  173. s.Humanoid.WalkSpeed = 11
  174. end
  175. end
  176. end
  177. end
  178. end
  179. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement