Advertisement
brianspy

Untitled

Sep 28th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.97 KB | None | 0 0
  1. props = {
  2. {"Part", "FakeHead", BrickColor.new("Dark orange"), Enum.Material.Plastic, 0, 0, true, Enum.FormFactor.Custom, Enum.PartType.Block, Vector3.new(0.600000024, 0.600000024, 0.600000024), Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, CFrame.new(0.100388065, 18.1003742, 23.299799, -0.999996185, -8.13055522e-007, 5.31445039e-007, -5.31440719e-007, 1.87754631e-006, 1.00000095, 8.12811663e-007, 0.999996245, 1.84774399e-006)},
  3. {"Part", "Head", BrickColor.new("Dark orange"), Enum.Material.Plastic, 0, 0, true, Enum.FormFactor.Custom, Enum.PartType.Block, Vector3.new(0.600000024, 0.800000012, 0.600000143), Enum.SurfaceType.Smooth, Enum.SurfaceType.Inlet, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, CFrame.new(0.100388199, 17.9003735, 22.9997997, 9.81613994e-007, -1.6822014e-007, 0.999996185, 0.707106173, 0.707108796, 4.87729267e-007, -0.707102835, 0.707105458, -8.12811777e-007)},
  4. {"Part", "Left Arm", BrickColor.new("Dark orange"), Enum.Material.Plastic, 0, 0, false, Enum.FormFactor.Custom, Enum.PartType.Block, Vector3.new(0.400000006, 1.20000005, 0.400000006), Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Studs, CFrame.new(0.400146782, 16.7069683, 22.8387585, 0.00159182027, 5.33444677e-007, -0.999994934, -0.0503749102, 0.998731315, -8.07183023e-005, 0.998725235, 0.0503784381, 0.0015914517)},
  5. {"Part", "Left Leg", BrickColor.new("Dark orange"), Enum.Material.Plastic, 0, 0, false, Enum.FormFactor.Custom, Enum.PartType.Block, Vector3.new(0.400000006, 1.20000005, 0.400000006), Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Studs, CFrame.new(0.395848215, 16.7976437, 21.0410557, 0.00159182027, 5.33444677e-007, -0.999994934, -0.0503749102, 0.998731315, -8.07183023e-005, 0.998725235, 0.0503784381, 0.0015914517)},
  6. {"Part", "Nose", BrickColor.new("Dark orange"), Enum.Material.Plastic, 0, 0, true, Enum.FormFactor.Custom, Enum.PartType.Block, Vector3.new(0.400000006, 0.400000006, 0.400000006), Enum.SurfaceType.Smooth, Enum.SurfaceType.Inlet, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, CFrame.new(0.100409508, 18.0003757, 23.7997837, -0.999996185, -8.13055408e-007, 5.31443845e-007, -5.31442083e-007, 2.05634728e-006, 1.00000095, 8.12811663e-007, 0.999996245, 1.66894381e-006)},
  7. {"Part", "Right Arm", BrickColor.new("Dark orange"), Enum.Material.Plastic, 0, 0, false, Enum.FormFactor.Custom, Enum.PartType.Block, Vector3.new(0.400000006, 1.20000005, 0.400000006), Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Studs, CFrame.new(-0.199849263, 16.7068958, 22.8401909, 0.00159182027, 5.33444677e-007, -0.999994934, -0.0503749102, 0.998731315, -8.07183023e-005, 0.998725235, 0.0503784381, 0.0015914517)},
  8. {"Part", "Right Leg", BrickColor.new("Dark orange"), Enum.Material.Plastic, 0, 0, false, Enum.FormFactor.Custom, Enum.PartType.Block, Vector3.new(0.400000006, 1.20000005, 0.400000006), Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Studs, CFrame.new(-0.204147831, 16.7975712, 21.0424881, 0.00159182027, 5.33444677e-007, -0.999994934, -0.0503749102, 0.998731315, -8.07183023e-005, 0.998725235, 0.0503784381, 0.0015914517)},
  9. {"Part", "Tail", BrickColor.new("Dark orange"), Enum.Material.Plastic, 0, 0, false, Enum.FormFactor.Custom, Enum.PartType.Block, Vector3.new(0.200000003, 1.20000005, 0.200000003), Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, CFrame.new(0.0946565717, 17.6217804, 20.5827122, 9.81613994e-007, -1.6822014e-007, 0.999996185, 0.707106173, 0.707108796, 4.87729267e-007, -0.707102835, 0.707105458, -8.12811777e-007)},
  10. {"Part", "Torso", BrickColor.new("Dark orange"), Enum.Material.Plastic, 0, 0, true, Enum.FormFactor.Custom, Enum.PartType.Block, Vector3.new(1, 0.800000012, 2.20000029), Enum.SurfaceType.Smooth, Enum.SurfaceType.Inlet, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Studs, CFrame.new(0.0980000049, 17.7510014, 21.9910011, -0.999993324, 5.33444677e-007, -0.0023880899, -0.000120830518, 0.998731315, 0.0503748283, 0.00238671037, 0.0503784381, -0.998723626)},
  11. {"WedgePart", "Left Ear", BrickColor.new("Dark orange"), Enum.Material.Plastic, 0, 0, true, Enum.FormFactor.Custom, Vector3.new(0.200000003, 0.600000024, 0.200000003), Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, CFrame.new(0.500348866, 18.090374, 23.1997814, -7.77199602e-007, 5.32613967e-007, -0.999996185, 8.9403602e-007, 1.00000095, -5.30270995e-007, 0.999996245, 2.83124973e-006, 8.48668094e-007)},
  12. {"WedgePart", "Right Ear", BrickColor.new("Dark orange"), Enum.Material.Plastic, 0, 0, true, Enum.FormFactor.Custom, Vector3.new(0.200000003, 0.600000024, 0.200000003), Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth, CFrame.new(-0.299625933, 18.090374, 23.1997833, 7.77199602e-007, 5.326105e-007, 0.999996185, -8.04604042e-007, 1.00000095, 5.30274406e-007, -0.999996245, 2.92068125e-006, -8.48668151e-007)}
  13. }
  14.  
  15. owner = "luxulux" --Your name here
  16.  
  17. if game.Workspace:findFirstChild(owner .. "'s Dog") then
  18. game.Workspace[owner .. "'s Dog"]:Destroy()
  19. end
  20.  
  21. model = Instance.new("Model")
  22. model.Name = owner .. "'s Dog"
  23.  
  24. for p = 1, #props do
  25. part = Instance.new(props[p][1], model)
  26. part.Anchored = true
  27. part.Locked = true
  28. if props[p][1] == "Part" then
  29. brick = {"Part", "Name", "BrickColor", "Material", "Reflectance", "Transparency", "CanCollide", "FormFactor", "Shape", "Size", "BackSurface", "BottomSurface", "FrontSurface", "LeftSurface", "RightSurface", "TopSurface", "CFrame"}
  30. elseif props[p][1] == "WedgePart" then
  31. brick = {"WedgePart", "Name", "BrickColor", "Material", "Reflectance", "Transparency", "CanCollide", "FormFactor", "Size", "BackSurface", "BottomSurface", "FrontSurface", "LeftSurface", "RightSurface", "TopSurface", "CFrame"}
  32. elseif props[p][1] == "CornerWedgePart" then
  33. brick = {"CornerWedgePart", "Name", "BrickColor", "Material", "Reflectance", "Transparency", "CanCollide", "Size", "BackSurface", "BottomSurface", "FrontSurface", "LeftSurface", "RightSurface", "TopSurface", "CFrame"}
  34. elseif props[p][1] == "TrussPart" then
  35. brick = {"TrussPart", "Name", "BrickColor", "Material", "Reflectance", "Transparency", "CanCollide", "Size", "Style", "BackSurface", "BottomSurface", "FrontSurface", "LeftSurface", "RightSurface", "TopSurface", "CFrame"}
  36. elseif props[p][1] == "Seat" then
  37. brick = {"Seat", "Name", "BrickColor", "Material", "Reflectance", "Transparency", "CanCollide", "Disabled", "FormFactor", "Shape", "Size", "BackSurface", "BottomSurface", "FrontSurface", "LeftSurface", "RightSurface", "TopSurface", "CFrame"}
  38. elseif props[p][1] == "VehicleSeat" then
  39. brick = {"VehicleSeat", "Name", "BrickColor", "Material", "Reflectance", "Transparency", "CanCollide", "Disabled", "HeadsUpDisplay", "MaxSpeed", "Torque", "TurnSpeed", "Size", "BackSurface", "BottomSurface", "FrontSurface", "LeftSurface", "RightSurface", "TopSurface", "CFrame"}
  40. elseif props[p][1] == "SkatboardPlatform" then
  41. brick = {"SkateboardPatform", "Name", "BrickColor", "Material", "Reflectance", "Transparency", "CanCollide", "StickyWheels", "FormFactor", "Shape", "Size", "BackSurface", "BottomSurface", "FrontSurface", "LeftSurface", "RightSurface", "TopSurface", "CFrame"}
  42. elseif props[p][1] == "SpawnLocation" then
  43. brick = {"SpawnLocation", "Name", "BrickColor", "Material", "Reflectance", "Transparency", "CanCollide", "AllowTeamChangeOnTouch", "Neutral", "TeamColor", "Duration", "FormFactor", "Shape", "Size", "BackSurface", "BottomSurface", "FrontSurface", "LeftSurface", "RightSurface", "TopSurface", "CFrame"}
  44. elseif props[p][1] == "FlagStand" then
  45. brick = {"FlagStand", "Name", "BrickColor", "Material", "Reflectance", "Transparency", "CanCollide", "TeamColor", "FormFactor", "Shape", "Size", "BackSurface", "BottomSurface", "FrontSurface", "LeftSurface", "RightSurface", "TopSurface", "CFrame"}
  46. end
  47. for b = 2, #props[p] do
  48. prop = props[p][b]
  49. proptype = type(prop)
  50. if proptype ~= "table" then
  51. part[brick[b]] = prop
  52. else
  53. equip = Instance.new(props[p][b][1], part)
  54. if props[p][b][1] == "Decal" then
  55. brickequip = {"Decal", "Name", "Shiny", "Specular", "Texture", "Transparency", "Face"}
  56. elseif props[p][b][1] == "Texture" then
  57. brickequip = {"Texture", "Name", "Shiny", "Specular", "StudsPerTileU", "StudsPerTileV", "Texture", "Transparency", "Face"}
  58. elseif props[p][b][1] == "Fire" then
  59. brickequip = {"Fire", "Name", "Color", "Enabled", "Heat", "SecondaryColor", "Size"}
  60. elseif props[p][b][1] == "Smoke" then
  61. brickequip = {"Smoke", "Name", "Color", "Enabled", "Opacity", "RiseVelocity", "Size"}
  62. elseif props[p][b][1] == "Sparkles" then
  63. brickequip = {"Sparkles", "Name", "Enabled", "SparkleColor"}
  64. elseif props[p][b][1] == "BlockMesh" then
  65. brickequip = {"BlockMesh", "Name", "Offset", "Scale", "VertexColor"}
  66. elseif props[p][b][1] == "CylinderMesh" then
  67. brickequip = {"CylinderMesh", "Name", "Offset", "Scale", "VertexColor"}
  68. elseif props[p][b][1] == "SpecialMesh" then
  69. brickequip = {"SpecialMesh", "Name", "MeshId", "MeshType", "Offset", "Scale", "TextureId", "VertexColor"}
  70. end
  71. for e = 2, #brickequip do
  72. equip[brickequip[e]] = props[p][b][e]
  73. end
  74. end
  75. end
  76. end
  77.  
  78. function makeJoint(x, y, C0, C1)
  79. joint = Instance.new("Motor")
  80. joint.Part0 = x
  81. joint.Part1 = y
  82. local HitPos = x.Position
  83. joint.Parent = x
  84. joint.C0 = C0
  85. joint.C1 = C1
  86. return joint
  87. end
  88.  
  89. function makeWeld(x, y)
  90. weld = Instance.new("Motor")
  91. weld.Part0 = x
  92. weld.Part1 = y
  93. local HitPos = x.Position
  94. local CJ = CFrame.new(HitPos)
  95. local C0 = x.CFrame:inverse() * CJ
  96. local C1 = y.CFrame:inverse() * CJ
  97. weld.C0 = C0
  98. weld.C1 = C1
  99. weld.Parent = x
  100. return joint
  101. end
  102.  
  103. LeftHip = makeJoint(model.Torso, model["Left Leg"], CFrame.new(-0.300000012, 0, 0.899999976, 0.000796274282, 0, 0.999999702, 0, 1, 0, -0.999999702, 0, 0.000796274282), CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1))
  104. LeftHip.MaxVelocity = 1
  105. RightHip = makeJoint(model.Torso, model["Right Leg"], CFrame.new(0.300000012, 0, 0.899999917, 0.000796274282, 0, 0.999999702, 0, 1, 0, -0.999999702, 0, 0.000796274282), CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1))
  106. RightHip.MaxVelocity = 1
  107. LeftShoulder = makeJoint(model.Torso, model["Left Arm"], CFrame.new(-0.300000012, -2.23517418e-008, -0.900000036, 0.000796274282, 0, 0.999999702, 0, 1, 0, -0.999999702, 0, 0.000796274282), CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1))
  108. LeftShoulder.MaxVelocity = 0.15
  109. RightShoulder = makeJoint(model.Torso, model["Right Arm"], CFrame.new(0.300000012, -1.49011612e-008, -0.900000036, 0.000796274282, 0, 0.999999702, 0, 1, 0, -0.999999702, 0, 0.000796274282), CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1))
  110. RightShoulder.MaxVelocity = 0.15
  111. Neck = makeJoint(model.Torso, model.Head, CFrame.new(0, 0.200000018, -1, -0.00177218916, 0.00160199252, -0.999997139, 0.670587182, 0.741830766, 0, 0.74182862, -0.670585275, -0.00238893996), CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1))
  112. TailJoint = makeJoint(model.Torso, model.Tail, CFrame.new(0, -0.199999988, 1.39999998, -0.00177218916, 0.00160199252, -0.999997139, 0.670587182, 0.741830766, 0, 0.74182862, -0.670585275, -0.00238893996), CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1))
  113.  
  114. makeWeld(model.FakeHead, model.Head)
  115. makeWeld(model.FakeHead, model.Nose)
  116. makeWeld(model.FakeHead, model["Left Ear"])
  117. makeWeld(model.FakeHead, model["Right Ear"])
  118.  
  119. balance = Instance.new("BodyGyro", model.Torso)
  120. balance.maxTorque = Vector3.new(math.huge, 0, math.huge)
  121.  
  122. parts = model:GetChildren()
  123. for p = 1, #parts do
  124. parts[p].Anchored = false
  125. end
  126.  
  127. Humanoid = Instance.new("Humanoid", model)
  128.  
  129. model.Parent = game.Workspace
  130.  
  131. function waitForChild(parent, childName)
  132. local child = parent:findFirstChild(childName)
  133. if child then return child end
  134. while true do
  135. child = parent.ChildAdded:wait()
  136. if child.Name==childName then return child end
  137. end
  138. end
  139.  
  140. -- ANIMATION
  141.  
  142. -- declarations
  143.  
  144. local Figure = model
  145. local pose = "Standing"
  146.  
  147. local toolAnim = "None"
  148. local toolAnimTime = 0
  149.  
  150. -- functions
  151.  
  152. function onRunning(speed)
  153. if speed>0 then
  154. pose = "Running"
  155. else
  156. pose = "Standing"
  157. end
  158. end
  159.  
  160. function onDied()
  161. pose = "Dead"
  162. wait(3)
  163. Figure:Destroy()
  164. end
  165.  
  166. function onJumping()
  167. pose = "Jumping"
  168. end
  169.  
  170. function onClimbing()
  171. pose = "Climbing"
  172. end
  173.  
  174. function onGettingUp()
  175. pose = "GettingUp"
  176. end
  177.  
  178. function onFreeFall()
  179. pose = "FreeFall"
  180. end
  181.  
  182. function onFallingDown()
  183. pose = "FallingDown"
  184. end
  185.  
  186. function onSeated()
  187. pose = "Seated"
  188. end
  189.  
  190. function onPlatformStanding()
  191. pose = "PlatformStanding"
  192. end
  193.  
  194. function onSwimming(speed)
  195. if speed>0 then
  196. pose = "Running"
  197. else
  198. pose = "Standing"
  199. end
  200. end
  201.  
  202. function moveJump()
  203. RightShoulder.MaxVelocity = 0.5
  204. LeftShoulder.MaxVelocity = 0.5
  205. RightShoulder.DesiredAngle = 0.735
  206. LeftShoulder.DesiredAngle = 0.735
  207. RightHip.DesiredAngle = -0.735
  208. LeftHip.DesiredAngle = -0.735
  209. end
  210.  
  211.  
  212. -- same as jump for now
  213.  
  214. function moveFreeFall()
  215. RightShoulder.MaxVelocity = 0.5
  216. LeftShoulder.MaxVelocity = 0.5
  217. RightShoulder.DesiredAngle = 0.735
  218. LeftShoulder.DesiredAngle = 0.735
  219. RightHip.DesiredAngle = -0.735
  220. LeftHip.DesiredAngle = -0.735
  221. end
  222.  
  223. function moveSit()
  224. RightShoulder.MaxVelocity = 0.15
  225. LeftShoulder.MaxVelocity = 0.15
  226. RightShoulder.DesiredAngle = 3.14 /2
  227. LeftShoulder.DesiredAngle = 3.14 /2
  228. RightHip.DesiredAngle = 3.14 /2
  229. LeftHip.DesiredAngle = 3.14 /2
  230. end
  231.  
  232. function getTool()
  233. for _, kid in ipairs(Figure:GetChildren()) do
  234. if kid.className == "Tool" then return kid end
  235. end
  236. return nil
  237. end
  238.  
  239. function getToolAnim(tool)
  240. for _, c in ipairs(tool:GetChildren()) do
  241. if c.Name == "toolanim" and c.className == "StringValue" then
  242. return c
  243. end
  244. end
  245. return nil
  246. end
  247.  
  248. function animateTool()
  249.  
  250. if (toolAnim == "None") then
  251. RightShoulder.DesiredAngle = 1.57
  252. return
  253. end
  254.  
  255. if (toolAnim == "Slash") then
  256. RightShoulder.MaxVelocity = 0.5
  257. RightShoulder.DesiredAngle = 0
  258. return
  259. end
  260.  
  261. if (toolAnim == "Lunge") then
  262. RightShoulder.MaxVelocity = 0.5
  263. LeftShoulder.MaxVelocity = 0.5
  264. RightShoulder.DesiredAngle = 1.57
  265. LeftShoulder.DesiredAngle = 1.0
  266. RightHip.DesiredAngle = 1.57
  267. LeftHip.DesiredAngle = 1.0
  268. return
  269. end
  270. end
  271.  
  272. function move(time)
  273. local amplitude
  274. local frequency
  275.  
  276. if (pose == "Jumping") then
  277. moveJump()
  278. return
  279. end
  280.  
  281. if (pose == "FreeFall") then
  282. moveFreeFall()
  283. return
  284. end
  285.  
  286. if (pose == "Seated") then
  287. moveSit()
  288. return
  289. end
  290.  
  291. local climbFudge = 0
  292.  
  293. if (pose == "Running") then
  294. RightShoulder.MaxVelocity = 0.15
  295. LeftShoulder.MaxVelocity = 0.15
  296. amplitude = 1
  297. frequency = 9
  298. elseif (pose == "Climbing") then
  299. RightShoulder.MaxVelocity = 0.5
  300. LeftShoulder.MaxVelocity = 0.5
  301. amplitude = 1
  302. frequency = 9
  303. climbFudge = 0
  304. else
  305. amplitude = 0.1
  306. frequency = 1
  307. end
  308.  
  309. desiredAngle = amplitude * math.sin(time*frequency)
  310.  
  311. RightShoulder.DesiredAngle = desiredAngle + climbFudge
  312. LeftShoulder.DesiredAngle = desiredAngle - climbFudge
  313. RightHip.DesiredAngle = -desiredAngle
  314. LeftHip.DesiredAngle = -desiredAngle
  315.  
  316.  
  317. local tool = getTool()
  318.  
  319. if tool then
  320.  
  321. animStringValueObject = getToolAnim(tool)
  322.  
  323. if animStringValueObject then
  324. toolAnim = animStringValueObject.Value
  325. -- message recieved, delete StringValue
  326. animStringValueObject.Parent = nil
  327. toolAnimTime = time + .3
  328. end
  329.  
  330. if time > toolAnimTime then
  331. toolAnimTime = 0
  332. toolAnim = "None"
  333. end
  334.  
  335. animateTool()
  336.  
  337.  
  338. else
  339. toolAnim = "None"
  340. toolAnimTime = 0
  341. end
  342. end
  343.  
  344.  
  345. -- connect events
  346.  
  347. Humanoid.Died:connect(onDied)
  348. Humanoid.Running:connect(onRunning)
  349. Humanoid.Jumping:connect(onJumping)
  350. Humanoid.Climbing:connect(onClimbing)
  351. Humanoid.GettingUp:connect(onGettingUp)
  352. Humanoid.FreeFalling:connect(onFreeFall)
  353. Humanoid.FallingDown:connect(onFallingDown)
  354. Humanoid.Seated:connect(onSeated)
  355. Humanoid.PlatformStanding:connect(onPlatformStanding)
  356. Humanoid.Swimming:connect(onSwimming)
  357. -- main program
  358.  
  359. local runService = game:service("RunService");
  360.  
  361. if game.Players:findFirstChild(owner) then
  362. player = game.Players:findFirstChild(owner)
  363. end
  364.  
  365. player.Chatted:connect(function(chat)
  366. if string.lower(chat) == "sit" then
  367. Humanoid.Sit = true
  368. elseif string.lower(chat) == "come" then
  369. Humanoid.Sit = false
  370. elseif string.lower(string.sub(chat, 1, 6)) == "attack" then
  371. victims = {}
  372. if string.find(chat, ",") then
  373. list = string.lower(string.sub(chat, 8))
  374. if list then
  375. for name in string.gmatch(list, ",") do
  376. players = game.Players:GetPlayers()
  377. for p = 1, #players do
  378. added = false
  379. if string.find(string.lower(players[p].Name), name) then
  380. for v = 1, #victims do
  381. if victims[v] == players[p] then
  382. added = true
  383. end
  384. end
  385. if not added then
  386. table.insert(victims, players[p])
  387. end
  388. end
  389. end
  390. end
  391. end
  392. else
  393. name = string.lower(string.sub(chat, 8))
  394. if name then
  395. players = game.Players:GetPlayers()
  396. for p = 1, #players do
  397. if string.find(string.lower(players[p].Name), name) then
  398. table.insert(victims, players[p])
  399. end
  400. end
  401. end
  402. end
  403. if #victims > 0 then
  404. attack(1)
  405. end
  406. end
  407. end)
  408.  
  409. function attack(v)
  410. victim = victims[v].Character
  411. model.Nose.Touched:connect(function(part)
  412. if part.Parent == victim then
  413. victim.Humanoid.Health = 0
  414. v = v + 1
  415. if v <= #victims then
  416. attack(v)
  417. else
  418. victims = {}
  419. victim = nil
  420. end
  421. end
  422. end)
  423. end
  424.  
  425. while Figure.Parent~=nil do
  426. if player then
  427. if player.Character and not victim then
  428. Humanoid:MoveTo(player.Character:GetModelCFrame().p, player.Character.HumanoidRootPart)
  429. else
  430. if victim then
  431. Humanoid:MoveTo(victim:GetModelCFrame().p, victim.HumanoidRootPart)
  432. end
  433. end
  434. end
  435. local _, time = wait(0.1)
  436. move(time)
  437. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement