Advertisement
OofNoob

noob dummy test

Mar 28th, 2018
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.53 KB | None | 0 0
  1. function sandbox(var,func)
  2. local env = getfenv(func)
  3. local newenv = setmetatable({},{
  4. __index = function(self,k)
  5. if k=="script" then
  6. return var
  7. else
  8. return env[k]
  9. end
  10. end,
  11. })
  12. setfenv(func,newenv)
  13. return func
  14. end
  15. cors = {}
  16. mas = Instance.new("Model",game:GetService("Lighting"))
  17. Model0 = Instance.new("Model")
  18. Part1 = Instance.new("Part")
  19. SpecialMesh2 = Instance.new("SpecialMesh")
  20. Decal3 = Instance.new("Decal")
  21. Part4 = Instance.new("Part")
  22. Decal5 = Instance.new("Decal")
  23. Motor6D6 = Instance.new("Motor6D")
  24. Motor6D7 = Instance.new("Motor6D")
  25. Motor6D8 = Instance.new("Motor6D")
  26. Motor6D9 = Instance.new("Motor6D")
  27. Motor6D10 = Instance.new("Motor6D")
  28. Fire11 = Instance.new("Fire")
  29. Script12 = Instance.new("Script")
  30. Part13 = Instance.new("Part")
  31. Part14 = Instance.new("Part")
  32. Part15 = Instance.new("Part")
  33. Fire16 = Instance.new("Fire")
  34. Script17 = Instance.new("Script")
  35. Part18 = Instance.new("Part")
  36. Fire19 = Instance.new("Fire")
  37. Script20 = Instance.new("Script")
  38. Humanoid21 = Instance.new("Humanoid")
  39. IntValue22 = Instance.new("IntValue")
  40. Script23 = Instance.new("Script")
  41. Script24 = Instance.new("Script")
  42. Script25 = Instance.new("Script")
  43. Script26 = Instance.new("Script")
  44. Model0.Name = "Noob Dummy"
  45. Model0.Parent = mas
  46. Model0.PrimaryPart = Part1
  47. Part1.Name = "Head"
  48. Part1.Parent = Model0
  49. Part1.BrickColor = BrickColor.new("New Yeller")
  50. Part1.Rotation = Vector3.new(0, -0.819999993, 0)
  51. Part1.FormFactor = Enum.FormFactor.Symmetric
  52. Part1.Size = Vector3.new(2, 1, 1)
  53. Part1.CFrame = CFrame.new(-60.4040413, 4.5000329, 85.1289978, 0.999896824, -4.08622753e-07, -0.0143436985, 4.07144455e-07, 1, -1.05978017e-07, 0.0143436985, 1.00128666e-07, 0.999896824)
  54. Part1.TopSurface = Enum.SurfaceType.Smooth
  55. Part1.Color = Color3.new(1, 1, 0)
  56. Part1.Position = Vector3.new(-60.4040413, 4.5000329, 85.1289978)
  57. Part1.Orientation = Vector3.new(0, -0.819999993, 0)
  58. Part1.Color = Color3.new(1, 1, 0)
  59. SpecialMesh2.Parent = Part1
  60. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  61. SpecialMesh2.Scale = Vector3.new(1.25, 1.25, 1.25)
  62. Decal3.Parent = Part1
  63. Decal3.Texture = "rbxassetid://143939169"
  64. Part4.Name = "Torso"
  65. Part4.Parent = Model0
  66. Part4.BrickColor = BrickColor.new("Really blue")
  67. Part4.Rotation = Vector3.new(0, -0.819999993, 0)
  68. Part4.FormFactor = Enum.FormFactor.Symmetric
  69. Part4.Size = Vector3.new(2, 2, 1)
  70. Part4.CFrame = CFrame.new(-60.4040413, 3.0000329, 85.1289978, 0.999896824, -4.08622753e-07, -0.0143436985, 4.07144455e-07, 1, -1.05978017e-07, 0.0143436985, 1.00128666e-07, 0.999896824)
  71. Part4.LeftSurface = Enum.SurfaceType.Weld
  72. Part4.RightSurface = Enum.SurfaceType.Weld
  73. Part4.Color = Color3.new(0, 0, 1)
  74. Part4.Position = Vector3.new(-60.4040413, 3.0000329, 85.1289978)
  75. Part4.Orientation = Vector3.new(0, -0.819999993, 0)
  76. Part4.Color = Color3.new(0, 0, 1)
  77. Decal5.Name = "roblox"
  78. Decal5.Parent = Part4
  79. Motor6D6.Name = "Right Shoulder"
  80. Motor6D6.Parent = Part4
  81. Motor6D6.C0 = CFrame.new(-2, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  82. Motor6D6.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  83. Motor6D6.Part0 = Part14
  84. Motor6D6.Part1 = Part4
  85. Motor6D6.MaxVelocity = 0.15000000596046
  86. Motor6D7.Name = "Left Shoulder"
  87. Motor6D7.Parent = Part4
  88. Motor6D7.C0 = CFrame.new(2, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  89. Motor6D7.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  90. Motor6D7.Part0 = Part13
  91. Motor6D7.Part1 = Part4
  92. Motor6D7.MaxVelocity = 0.15000000596046
  93. Motor6D8.Name = "Right Hip"
  94. Motor6D8.Parent = Part4
  95. Motor6D8.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  96. Motor6D8.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  97. Motor6D8.Part0 = Part4
  98. Motor6D8.Part1 = Part18
  99. Motor6D8.MaxVelocity = 0.10000000149012
  100. Motor6D9.Name = "Left Hip"
  101. Motor6D9.Parent = Part4
  102. Motor6D9.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  103. Motor6D9.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  104. Motor6D9.Part0 = Part4
  105. Motor6D9.Part1 = Part15
  106. Motor6D9.MaxVelocity = 0.10000000149012
  107. Motor6D10.Name = "Neck"
  108. Motor6D10.Parent = Part4
  109. Motor6D10.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  110. Motor6D10.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  111. Motor6D10.Part0 = Part4
  112. Motor6D10.Part1 = Part1
  113. Motor6D10.MaxVelocity = 0.10000000149012
  114. Fire11.Parent = Part4
  115. Fire11.Size = 30
  116. Fire11.Color = Color3.new(1, 0.678431, 0)
  117. Fire11.Enabled = false
  118. Fire11.Heat = 25
  119. Fire11.SecondaryColor = Color3.new(1, 0, 0)
  120. Fire11.Color = Color3.new(1, 0.678431, 0)
  121. Script12.Name = "Spread"
  122. Script12.Parent = Fire11
  123. table.insert(cors,sandbox(Script12,function()
  124. function Spread(part)
  125. check = part:findFirstChild("Fire")
  126. if check == nil then
  127. script.Parent:Clone().Parent = part
  128.  
  129. elseif check ~= nil then
  130. check.Size = check.Size + 1000000
  131. check.Heat = check.Heat +1000000
  132. end
  133. end
  134.  
  135.  
  136. script.Parent.Parent.Touched:connect(Spread)
  137.  
  138. end))
  139. Part13.Name = "Left Arm"
  140. Part13.Parent = Model0
  141. Part13.BrickColor = BrickColor.new("New Yeller")
  142. Part13.Rotation = Vector3.new(0, -0.819999993, 0)
  143. Part13.CanCollide = false
  144. Part13.FormFactor = Enum.FormFactor.Symmetric
  145. Part13.Size = Vector3.new(1, 2, 1)
  146. Part13.CFrame = CFrame.new(-61.9038849, 3.00003219, 85.1074829, 0.999896824, -4.08622753e-07, -0.0143436985, 4.07144455e-07, 1, -1.05978017e-07, 0.0143436985, 1.00128666e-07, 0.999896824)
  147. Part13.Color = Color3.new(1, 1, 0)
  148. Part13.Position = Vector3.new(-61.9038849, 3.00003219, 85.1074829)
  149. Part13.Orientation = Vector3.new(0, -0.819999993, 0)
  150. Part13.Color = Color3.new(1, 1, 0)
  151. Part14.Name = "Right Arm"
  152. Part14.Parent = Model0
  153. Part14.BrickColor = BrickColor.new("New Yeller")
  154. Part14.Rotation = Vector3.new(0, -0.819999993, 0)
  155. Part14.CanCollide = false
  156. Part14.FormFactor = Enum.FormFactor.Symmetric
  157. Part14.Size = Vector3.new(1, 2, 1)
  158. Part14.CFrame = CFrame.new(-58.9041977, 3.00003362, 85.1505127, 0.999896824, -4.08622753e-07, -0.0143436985, 4.07144455e-07, 1, -1.05978017e-07, 0.0143436985, 1.00128666e-07, 0.999896824)
  159. Part14.Color = Color3.new(1, 1, 0)
  160. Part14.Position = Vector3.new(-58.9041977, 3.00003362, 85.1505127)
  161. Part14.Orientation = Vector3.new(0, -0.819999993, 0)
  162. Part14.Color = Color3.new(1, 1, 0)
  163. Part15.Name = "Left Leg"
  164. Part15.Parent = Model0
  165. Part15.BrickColor = BrickColor.new("Lime green")
  166. Part15.Rotation = Vector3.new(0, -0.819999993, 0)
  167. Part15.CanCollide = false
  168. Part15.FormFactor = Enum.FormFactor.Symmetric
  169. Part15.Size = Vector3.new(1, 2, 1)
  170. Part15.CFrame = CFrame.new(-60.9039879, 1.00003266, 85.1218262, 0.999896824, -4.08622753e-07, -0.0143436985, 4.07144455e-07, 1, -1.05978017e-07, 0.0143436985, 1.00128666e-07, 0.999896824)
  171. Part15.BottomSurface = Enum.SurfaceType.Smooth
  172. Part15.Color = Color3.new(0, 1, 0)
  173. Part15.Position = Vector3.new(-60.9039879, 1.00003266, 85.1218262)
  174. Part15.Orientation = Vector3.new(0, -0.819999993, 0)
  175. Part15.Color = Color3.new(0, 1, 0)
  176. Fire16.Parent = Part15
  177. Fire16.Size = 30
  178. Fire16.Color = Color3.new(1, 0.678431, 0)
  179. Fire16.Enabled = false
  180. Fire16.Heat = 25
  181. Fire16.SecondaryColor = Color3.new(1, 0, 0)
  182. Fire16.Color = Color3.new(1, 0.678431, 0)
  183. Script17.Name = "Spread"
  184. Script17.Parent = Fire16
  185. table.insert(cors,sandbox(Script17,function()
  186. function Spread(part)
  187. check = part:findFirstChild("Fire")
  188. if check == nil then
  189. script.Parent:Clone().Parent = part
  190.  
  191. elseif check ~= nil then
  192. check.Size = check.Size + 1000000
  193. check.Heat = check.Heat +1000000
  194. end
  195. end
  196.  
  197.  
  198. script.Parent.Parent.Touched:connect(Spread)
  199.  
  200. end))
  201. Part18.Name = "Right Leg"
  202. Part18.Parent = Model0
  203. Part18.BrickColor = BrickColor.new("Lime green")
  204. Part18.Rotation = Vector3.new(0, -0.819999993, 0)
  205. Part18.CanCollide = false
  206. Part18.FormFactor = Enum.FormFactor.Symmetric
  207. Part18.Size = Vector3.new(1, 2, 1)
  208. Part18.CFrame = CFrame.new(-59.9040909, 1.00003314, 85.1361694, 0.999896824, -4.08622753e-07, -0.0143436985, 4.07144455e-07, 1, -1.05978017e-07, 0.0143436985, 1.00128666e-07, 0.999896824)
  209. Part18.BottomSurface = Enum.SurfaceType.Smooth
  210. Part18.Color = Color3.new(0, 1, 0)
  211. Part18.Position = Vector3.new(-59.9040909, 1.00003314, 85.1361694)
  212. Part18.Orientation = Vector3.new(0, -0.819999993, 0)
  213. Part18.Color = Color3.new(0, 1, 0)
  214. Fire19.Parent = Part18
  215. Fire19.Size = 30
  216. Fire19.Color = Color3.new(1, 0.678431, 0)
  217. Fire19.Enabled = false
  218. Fire19.Heat = 25
  219. Fire19.SecondaryColor = Color3.new(1, 0, 0)
  220. Fire19.Color = Color3.new(1, 0.678431, 0)
  221. Script20.Name = "Spread"
  222. Script20.Parent = Fire19
  223. table.insert(cors,sandbox(Script20,function()
  224. function Spread(part)
  225. check = part:findFirstChild("Fire")
  226. if check == nil then
  227. script.Parent:Clone().Parent = part
  228.  
  229. elseif check ~= nil then
  230. check.Size = check.Size + 1000000
  231. check.Heat = check.Heat +1000000
  232. end
  233. end
  234.  
  235.  
  236. script.Parent.Parent.Touched:connect(Spread)
  237.  
  238. end))
  239. Humanoid21.Parent = Model0
  240. Humanoid21.RightLeg = Part18
  241. Humanoid21.LeftLeg = Part15
  242. Humanoid21.Torso = Part4
  243. IntValue22.Name = "Mode"
  244. IntValue22.Parent = Model0
  245. Script23.Name = "Move"
  246. Script23.Parent = Model0
  247. table.insert(cors,sandbox(Script23,function()
  248. local CurrentPart = nil
  249. local MaxInc = 16
  250.  
  251. function onTouched(hit)
  252. if hit.Parent == nil then
  253. return
  254. end
  255.  
  256. local humanoid = hit.Parent:findFirstChild("Humanoid")
  257.  
  258. if humanoid == nil then
  259. CurrentPart = hit
  260. end
  261. end
  262.  
  263. function waitForChild(parent, childName)
  264. local child = parent:findFirstChild(childName)
  265.  
  266. if child then
  267. return child
  268. end
  269.  
  270. while true do
  271. print(childName)
  272.  
  273. child = parent.ChildAdded:wait()
  274.  
  275. if child.Name==childName then
  276. return child
  277. end
  278. end
  279. end
  280.  
  281. local Figure = script.Parent
  282. local Humanoid = waitForChild(Figure, "Humanoid")
  283. local Torso = waitForChild(Figure, "Torso")
  284. local Left = waitForChild(Figure, "Left Leg")
  285. local Right = waitForChild(Figure, "Right Leg")
  286.  
  287. Humanoid.Jump = true
  288.  
  289. Left.Touched:connect(onTouched)
  290. Right.Touched:connect(onTouched)
  291.  
  292. while true do
  293. wait(math.random(2, 6))
  294.  
  295. if CurrentPart ~= nil then
  296. if math.random(1, 2) == 1 then
  297. Humanoid.Jump = false
  298. end
  299.  
  300. Humanoid:MoveTo(Torso.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)), CurrentPart)
  301. end
  302. end
  303. end))
  304. Script24.Name = "Animation"
  305. Script24.Parent = Model0
  306. table.insert(cors,sandbox(Script24,function()
  307. ------------------
  308. --SPAWNING--
  309. ------------------
  310.  
  311. miked=script.Parent
  312.  
  313. itlh=miked.Torso:findFirstChild("Left Hip")
  314. itlh.Part0=miked.Torso
  315. itlh.Part1=miked:findFirstChild("Left Leg")
  316. itlh.C0=CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  317.  
  318. itrh=miked.Torso:findFirstChild("Right Hip")
  319. itrh.Part0=miked.Torso
  320. itrh.Part1=miked:findFirstChild("Right Leg")
  321. itrh.C0=CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  322.  
  323. itls=miked.Torso:findFirstChild("Left Shoulder")
  324. itls.Part1=miked.Torso
  325. itls.C0=CFrame.new(2, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  326. itls.Part0=miked:findFirstChild("Left Arm")
  327.  
  328. itrs=miked.Torso:findFirstChild("Right Shoulder")
  329. itrs.Part1=miked.Torso
  330. itrs.C0=CFrame.new(-2, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  331. itrs.Part0=miked:findFirstChild("Right Arm")
  332.  
  333. miked.Head:makeJoints()
  334. ------------------
  335. ------------------
  336.  
  337.  
  338.  
  339. function waitForChild(parent, childName)
  340. while true do
  341. local child = parent:findFirstChild(childName)
  342. if child then
  343. return child
  344. end
  345. parent.ChildAdded:wait()
  346. end
  347. end
  348.  
  349. local Figure = script.Parent
  350. local Torso = waitForChild(Figure, "Torso")
  351. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  352. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  353. local RightHip = waitForChild(Torso, "Right Hip")
  354. local LeftHip = waitForChild(Torso, "Left Hip")
  355. local Neck = waitForChild(Torso, "Neck")
  356. local Humanoid = waitForChild(Figure, "Humanoid")
  357. local pose = "Standing"
  358.  
  359. local toolAnim = "None"
  360. local toolAnimTime = 0
  361.  
  362. local isSeated = false
  363.  
  364.  
  365. function onRunning(speed)
  366. if isSeated then return end
  367.  
  368. if speed>0 then
  369. pose = "Running"
  370. else
  371. pose = "Standing"
  372. end
  373. end
  374.  
  375. function onDied()
  376. pose = "Dead"
  377.  
  378. local parts = Figure:GetChildren()
  379. for i=1,#parts do
  380. if parts.className == "Part" then
  381. Debris.AddItem(parts[i], 60)
  382. end
  383. end
  384. end
  385.  
  386. function onJumping()
  387. isSeated = false
  388. pose = "Jumping"
  389. end
  390.  
  391. function onClimbing()
  392. pose = "Climbing"
  393. end
  394.  
  395. function onGettingUp()
  396. pose = "GettingUp"
  397. end
  398.  
  399. function onFreeFall()
  400. pose = "FreeFall"
  401. end
  402.  
  403. function onDancing()
  404. pose = "Dancing"
  405. end
  406.  
  407. function onFallingDown()
  408. pose = "FallingDown"
  409. end
  410.  
  411. function onSeated()
  412. isSeated = true
  413. pose = "Seated"
  414. end
  415.  
  416.  
  417.  
  418. function moveJump()
  419. RightShoulder.MaxVelocity = 0.5
  420. LeftShoulder.MaxVelocity = 0.5
  421. RightShoulder.DesiredAngle = 3.1
  422. LeftShoulder.DesiredAngle = -3.1
  423. RightHip.DesiredAngle = 0
  424. LeftHip.DesiredAngle = 0
  425. end
  426.  
  427. function moveFreeFall()
  428. RightShoulder.MaxVelocity = 0.5
  429. LeftShoulder.MaxVelocity = 0.5
  430. RightShoulder.DesiredAngle = 3.1
  431. LeftShoulder.DesiredAngle = -3.1
  432. RightHip.DesiredAngle = 0
  433. LeftHip.DesiredAngle = 0
  434. end
  435.  
  436. function moveFloat()
  437. RightShoulder.MaxVelocity = 0.5
  438. LeftShoulder.MaxVelocity = 0.5
  439. RightShoulder.DesiredAngle = -1.57
  440. LeftShoulder.DesiredAngle = 1.57
  441. RightHip.DesiredAngle = 1.57
  442. LeftHip.DesiredAngle = -1.57
  443. end
  444.  
  445. function moveBoogy()
  446. while pose=="Boogy" do
  447. wait(.5)
  448. RightShoulder.MaxVelocity = 1
  449. LeftShoulder.MaxVelocity = 1
  450. RightShoulder.DesiredAngle = -3.14
  451. LeftShoulder.DesiredAngle = 0
  452. RightHip.DesiredAngle = 1.57
  453. LeftHip.DesiredAngle = 0
  454. wait(.5)
  455. RightShoulder.MaxVelocity = 1
  456. LeftShoulder.MaxVelocity = 1
  457. RightShoulder.DesiredAngle = 0
  458. LeftShoulder.DesiredAngle = -3.14
  459. RightHip.DesiredAngle = 0
  460. LeftHip.DesiredAngle = 1.57
  461. end
  462. end
  463.  
  464. function moveZombie()
  465. RightShoulder.MaxVelocity = 0.5
  466. LeftShoulder.MaxVelocity = 0.5
  467. RightShoulder.DesiredAngle = -1.57
  468. LeftShoulder.DesiredAngle = 1.57
  469. RightHip.DesiredAngle = 0
  470. LeftHip.DesiredAngle = 0
  471. end
  472.  
  473. function movePunch()
  474. script.Parent.Torso.Anchored=true
  475. RightShoulder.MaxVelocity = 60
  476. LeftShoulder.MaxVelocity = 0.5
  477. RightShoulder.DesiredAngle = -1.57
  478. LeftShoulder.DesiredAngle = 0
  479. RightHip.DesiredAngle = 0
  480. LeftHip.DesiredAngle = 0
  481. wait(1)
  482. script.Parent.Torso.Anchored=false
  483. pose="Standing"
  484.  
  485. end
  486.  
  487. function moveKick()
  488. RightShoulder.MaxVelocity = 0.5
  489. LeftShoulder.MaxVelocity = 0.5
  490. RightShoulder.DesiredAngle = 0
  491. LeftShoulder.DesiredAngle = 0
  492. RightHip.MaxVelocity = 40
  493. RightHip.DesiredAngle = 1.57
  494. LeftHip.DesiredAngle = 0
  495. wait(1)
  496. pose="Standing"
  497.  
  498. end
  499.  
  500. function moveFly()
  501. RightShoulder.MaxVelocity = 0.5
  502. LeftShoulder.MaxVelocity = 0.5
  503. RightShoulder.DesiredAngle = 0
  504. LeftShoulder.DesiredAngle = 0
  505. RightHip.MaxVelocity = 40
  506. RightHip.DesiredAngle = 1.57
  507. LeftHip.DesiredAngle = 0
  508. wait(1)
  509. pose="Standing"
  510.  
  511. end
  512.  
  513.  
  514. function moveClimb()
  515. RightShoulder.MaxVelocity = 0.5
  516. LeftShoulder.MaxVelocity = 0.5
  517. RightShoulder.DesiredAngle = -3.14
  518. LeftShoulder.DesiredAngle = 3.14
  519. RightHip.DesiredAngle = 0
  520. LeftHip.DesiredAngle = 0
  521. end
  522.  
  523. function moveSit()
  524. RightShoulder.MaxVelocity = 0.15
  525. LeftShoulder.MaxVelocity = 0.15
  526. RightShoulder.DesiredAngle = 3.14 /2
  527. LeftShoulder.DesiredAngle = -3.14 /2
  528. RightHip.DesiredAngle = 3.14 /2
  529. LeftHip.DesiredAngle = -3.14 /2
  530. end
  531.  
  532. function getTool()
  533.  
  534. kidTable = Figure:children()
  535. if (kidTable ~= nil) then
  536. numKids = #kidTable
  537. for i=1,numKids do
  538. if (kidTable[i].className == "Tool") then return kidTable[i] end
  539. end
  540. end
  541.  
  542. return nil
  543. end
  544.  
  545. function getToolAnim(tool)
  546.  
  547. c = tool:children()
  548. for i=1,#c do
  549. if (c[i].Name == "toolanim" and c[i].className == "StringValue") then
  550. return c[i]
  551. end
  552. end
  553. return nil
  554. end
  555.  
  556. function animateTool()
  557.  
  558. if (toolAnim == "None") then
  559. RightShoulder.DesiredAngle = 1.57
  560. return
  561. end
  562.  
  563. if (toolAnim == "Slash") then
  564. RightShoulder.MaxVelocity = 0.5
  565. RightShoulder.DesiredAngle = 0
  566. return
  567. end
  568.  
  569. if (toolAnim == "Lunge") then
  570. RightShoulder.MaxVelocity = 0.5
  571. LeftShoulder.MaxVelocity = 0.5
  572. RightHip.MaxVelocity = 0.5
  573. LeftHip.MaxVelocity = 0.5
  574. RightShoulder.DesiredAngle = -1.57
  575. LeftShoulder.DesiredAngle = 1.0
  576. RightHip.DesiredAngle = 1.57
  577. LeftHip.DesiredAngle = 1.0
  578. return
  579. end
  580. end
  581.  
  582. function move(time)
  583. local amplitude
  584. local frequency
  585.  
  586. if (pose == "Jumping") then
  587. moveJump()
  588. return
  589. end
  590.  
  591. if (pose == "Zombie") then
  592. moveZombie()
  593. return
  594. end
  595.  
  596. if (pose == "Boogy") then
  597. moveBoogy()
  598. return
  599. end
  600.  
  601. if (pose == "Float") then
  602. moveFloat()
  603. return
  604. end
  605.  
  606. if (pose == "Punch") then
  607. movePunch()
  608. return
  609. end
  610.  
  611. if (pose == "Kick") then
  612. moveKick()
  613. return
  614. end
  615.  
  616. if (pose == "Fly") then
  617. moveFly()
  618. return
  619. end
  620.  
  621. if (pose == "FreeFall") then
  622. moveFreeFall()
  623. return
  624. end
  625.  
  626. if (pose == "Climbing") then
  627. moveClimb()
  628. return
  629. end
  630.  
  631. if (pose == "Seated") then
  632. moveSit()
  633. return
  634. end
  635.  
  636. amplitude = 0.1
  637. frequency = 1
  638.  
  639. RightShoulder.MaxVelocity = 0.15
  640. LeftShoulder.MaxVelocity = 0.15
  641. if (pose == "Running") then
  642. amplitude = 1
  643. frequency = 9
  644. elseif (pose == "Dancing") then
  645. amplitude = 2
  646. frequency = 16
  647. end
  648.  
  649.  
  650. desiredAngle = amplitude * math.sin(time*frequency)
  651. if pose~="Dancing" then
  652. RightShoulder.DesiredAngle = desiredAngle
  653. LeftShoulder.DesiredAngle = desiredAngle
  654. RightHip.DesiredAngle = -desiredAngle
  655. LeftHip.DesiredAngle = -desiredAngle
  656. else
  657. RightShoulder.DesiredAngle = desiredAngle
  658. LeftShoulder.DesiredAngle = desiredAngle
  659. RightHip.DesiredAngle = -desiredAngle
  660. LeftHip.DesiredAngle = -desiredAngle
  661. end
  662.  
  663.  
  664.  
  665. local tool = getTool()
  666.  
  667. if tool ~= nil then
  668.  
  669. animStringValueObject = getToolAnim(tool)
  670.  
  671. if animStringValueObject ~= nil then
  672. toolAnim = animStringValueObject.Value
  673. -- message recieved, delete StringValue
  674. animStringValueObject.Parent = nil
  675. toolAnimTime = time - 4.3
  676. end
  677.  
  678. if time > toolAnimTime then
  679. toolAnimTime = 0
  680. toolAnim = "None"
  681. end
  682.  
  683. animateTool()
  684.  
  685.  
  686. else
  687. toolAnim = "None"
  688. toolAnimTime = 0
  689. end
  690. end
  691.  
  692.  
  693. -- connect events
  694. -----------------------------------------------------------------------------------------------------------------------
  695.  
  696. function unequip()
  697. local items=script.Parent:children()
  698. for i=1, #items do
  699. if items[i].className=="Tool" then items[i]:remove() end
  700. end
  701. end
  702.  
  703.  
  704.  
  705.  
  706. -----------------------------------------------------------------------------------------------------------------------
  707. -----------------------------------------------------------------------------------------------------------------------
  708. -----------------------------------------------------------------------------------------------------------------------
  709. -----------------------------------------------------------------------------------------------------------------------
  710. -----------------------------------------------------------------------------------------------------------------------
  711. -----------------------------------------------------------------------------------------------------------------------
  712. -----------------------------------------------------------------------------------------------------------------------
  713. -----------------------------------------------------------------------------------------------------------------------
  714. -----------------------------------------------------------------------------------------------------------------------
  715. -----------------------------------------------------------------------------------------------------------------------
  716. -----------------------------------------------------------------------------------------------------------------------
  717. -----------------------------------------------------------------------------------------------------------------------
  718. dist=20
  719.  
  720. function followany()
  721. following=true
  722. while following==true do
  723.  
  724. local ch=game.Players:children()
  725. for i=1, #ch do
  726. local l=game.Workspace:findFirstChild(ch[i].Name)
  727. if l~=nil then
  728. local s=l.Torso
  729. local p=l.Torso.Position
  730. local q=script.Parent.Torso.Position
  731. local d=math.sqrt( ((p.x-q.x)^2)+((p.y-q.y)^2)+((p.z-q.z)^2) )
  732. if smallest==nil then
  733. smallest=d
  734. target=s
  735. elseif d<smallest then
  736. smallest=d
  737. target=s
  738. end
  739. end
  740. end
  741.  
  742. if smallest==nil then stopmoving() return end
  743.  
  744. if smallest>6*dist then return end
  745.  
  746. script.Parent.Humanoid:MoveTo(target.Position, target)
  747.  
  748. wait(0.5)
  749. for i=1, 6 do
  750. if target.Parent.Humanoid.Health<1 then stopmoving() else wait(0.5) end
  751. end
  752. end
  753. end
  754.  
  755.  
  756.  
  757. function gohome()
  758. script.Parent.Humanoid:MoveTo(Vector3.new(0,0,0), game.Workspace.Bases.Base)
  759. end
  760.  
  761. function stopmoving()
  762. script.Parent.Humanoid:MoveTo(script.Parent.Torso.Position, script.Parent.Torso)
  763. end
  764.  
  765. function follow(name)
  766. following=true
  767.  
  768. local p=game.Workspace:findFirstChild(name)
  769. if p==nil then return end
  770. while following==true do
  771. script.Parent.Humanoid:MoveTo(p.Torso.Position, p.Torso)
  772. wait(0.5)
  773. for i=1, 3 do
  774. if p.Humanoid.Health<1 then following=false; stopmoving() return end
  775. wait(0.5)
  776. end
  777. end
  778. end
  779.  
  780.  
  781. -----------------------------------------------------------------------------------------------------------------------
  782. -----------------------------------------------------------------------------------------------------------------------
  783. -----------------------------------------------------------------------------------------------------------------------
  784. -----------------------------------------------------------------------------------------------------------------------
  785. -----------------------------------------------------------------------------------------------------------------------
  786. -----------------------------------------------------------------------------------------------------------------------
  787. -----------------------------------------------------------------------------------------------------------------------
  788. -----------------------------------------------------------------------------------------------------------------------
  789. -----------------------------------------------------------------------------------------------------------------------
  790. -----------------------------------------------------------------------------------------------------------------------
  791. -----------------------------------------------------------------------------------------------------------------------
  792. -----------------------------------------------------------------------------------------------------------------------
  793.  
  794.  
  795. Humanoid.Died:connect(onDied)
  796. Humanoid.Running:connect(onRunning)
  797. Humanoid.Jumping:connect(onJumping)
  798. Humanoid.Climbing:connect(onClimbing)
  799. Humanoid.GettingUp:connect(onGettingUp)
  800. Humanoid.FreeFalling:connect(onFreeFall)
  801. Humanoid.FallingDown:connect(onFallingDown)
  802. Humanoid.Seated:connect(onSeated)
  803.  
  804.  
  805. --[[
  806.  
  807. function newSound(id)
  808. local sound = Instance.new("Sound")
  809. sound.SoundId = id
  810. sound.Parent = script.Parent.Head
  811. return sound
  812. end
  813.  
  814.  
  815. local sDied = newSound("rbxasset://sounds/uuhhh.wav")
  816. local sFallingDown = newSound("rbxasset://sounds/splat.wav")
  817. local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
  818. local sGettingUp = newSound("rbxasset://sounds/hit.wav")
  819. local sJumping = newSound("rbxasset://sounds/button.wav")
  820. local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
  821. sRunning.Looped = true
  822.  
  823. local Figure = script.Parent
  824. local Head = waitForChild(Figure, "Head")
  825. local Humanoid = waitForChild(Figure, "Humanoid")
  826.  
  827.  
  828. function onDied()
  829. sDied:play()
  830. end
  831.  
  832. function onState(state, sound)
  833. if state then
  834. sound:play()
  835. else
  836. sound:pause()
  837. end
  838. end
  839.  
  840. function onRunning(speed)
  841. if speed>0 then
  842. sRunning:play()
  843. else
  844. sRunning:pause()
  845. end
  846. end
  847.  
  848.  
  849. Humanoid.Died:connect(onDied)
  850. Humanoid.Running:connect(onRunning)
  851. Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
  852. Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
  853. Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
  854. Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
  855. --]]
  856.  
  857. local nextTime = 0
  858. local runService = game:service("RunService");
  859.  
  860. while Figure.Parent~=nil do
  861. time = runService.Stepped:wait()
  862. if time > nextTime then
  863. move(time)
  864. nextTime = time + 0.1
  865. end
  866. end
  867.  
  868. end))
  869. Script25.Name = "Respawn"
  870. Script25.Parent = Model0
  871. table.insert(cors,sandbox(Script25,function()
  872. name="Humanoid"
  873.  
  874. robo=script.Parent:clone()
  875.  
  876. while true do
  877. wait(1)
  878. if script.Parent.Humanoid.Health<1 then
  879. robot=robo:clone()
  880. robot.Parent=script.Parent.Parent
  881. robot:makeJoints()
  882. script.Parent:remove()
  883. end
  884. end
  885.  
  886.  
  887.  
  888.  
  889. end))
  890. Script26.Parent = Model0
  891. table.insert(cors,sandbox(Script26,function()
  892. local larm = script.Parent:FindFirstChild("Left Arm")
  893. local rarm = script.Parent:FindFirstChild("Right Arm")
  894.  
  895. function findNearestTorso(pos)
  896. local list = game.Workspace:children()
  897. local torso = nil
  898. local dist = 1000
  899. local temp = nil
  900. local human = nil
  901. local temp2 = nil
  902. for x = 1, #list do
  903. temp2 = list[x]
  904. if (temp2.className == "Model") and (temp2 ~= script.Parent) then
  905. temp = temp2:findFirstChild("Torso")
  906. human = temp2:findFirstChild("Humanoid")
  907. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  908. if (temp.Position - pos).magnitude < dist then
  909. torso = temp
  910. dist = (temp.Position - pos).magnitude
  911. end
  912. end
  913. end
  914. end
  915. return torso
  916. end
  917.  
  918.  
  919.  
  920.  
  921. while true do
  922. wait(math.random(1,5))
  923. --local target = findNearestTorso(script.Parent.Torso.Position)
  924. --if target ~= nil then
  925. -- script.Parent.Zombie:MoveTo(target.Position, target)
  926. --end
  927.  
  928. script.Parent.Humanoid:MoveTo(Vector3.new(math.random(-100,100),0,math.random(-100,100)), game.Workspace.Base)
  929.  
  930.  
  931. end
  932.  
  933. end))
  934. for i,v in pairs(mas:GetChildren()) do
  935. v.Parent = game:GetService("Players").LocalPlayer.Character
  936. pcall(function() v:MakeJoints() end)
  937. end
  938. mas:Destroy()
  939. for i,v in pairs(cors) do
  940. spawn(function()
  941. pcall(v)
  942. end)
  943. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement