ShutThefickUp

Untitled

Aug 11th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 58.42 KB | None | 0 0
  1.  
  2. local runDummyScript = function(f,scri)
  3. local oldenv = getfenv(f)
  4. local newenv = setmetatable({}, {
  5. __index = function(_, k)
  6. if k:lower() == 'script' then
  7. return scri
  8. else
  9. return oldenv[k]
  10. end
  11. end
  12. })
  13. setfenv(f, newenv)
  14. ypcall(function() f() end)
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. mas.Name = "CompiledModel"
  19. o1 = Instance.new("Model")
  20. o2 = Instance.new("Model")
  21. o3 = Instance.new("Part")
  22. o5 = Instance.new("Humanoid")
  23. o7 = Instance.new("Part")
  24. o8 = Instance.new("SpecialMesh")
  25. o14 = Instance.new("SpecialMesh")
  26. o15 = Instance.new("Motor6D")
  27. o16 = Instance.new("Sound")
  28. o17 = Instance.new("Sound")
  29. o18 = Instance.new("Sound")
  30. o19 = Instance.new("Sound")
  31. o20 = Instance.new("Sound")
  32. o21 = Instance.new("Sound")
  33. o22 = Instance.new("Sound")
  34. o23 = Instance.new("Sound")
  35. o24 = Instance.new("Sound")
  36. o25 = Instance.new("Motor6D")
  37. o26 = Instance.new("Motor6D")
  38. o27 = Instance.new("Sound")
  39. o28 = Instance.new("Script")
  40. o29 = Instance.new("BodyColors")
  41. o30 = Instance.new("Script")
  42. o31 = Instance.new("Script")
  43. o32 = Instance.new("Script")
  44. o33 = Instance.new("Script")
  45. o34 = Instance.new("Script")
  46. o35 = Instance.new("Script")
  47. o38 = Instance.new("Vector3Value")
  48. o39 = Instance.new("Motor6D")
  49. o48 = Instance.new("Vector3Value")
  50. o49 = Instance.new("Motor6D")
  51. o60 = Instance.new("Vector3Value")
  52. o61 = Instance.new("Motor6D")
  53. o66 = Instance.new("Vector3Value")
  54. o67 = Instance.new("Motor6D")
  55. o71 = Instance.new("Vector3Value")
  56. o72 = Instance.new("Motor6D")
  57. o77 = Instance.new("Vector3Value")
  58. o78 = Instance.new("Motor6D")
  59. o82 = Instance.new("Vector3Value")
  60. o83 = Instance.new("Motor6D")
  61. o87 = Instance.new("Vector3Value")
  62. o88 = Instance.new("Motor6D")
  63. o92 = Instance.new("Vector3Value")
  64. o93 = Instance.new("Motor6D")
  65. o97 = Instance.new("Vector3Value")
  66. o98 = Instance.new("Motor6D")
  67. o101 = Instance.new("Vector3Value")
  68. o102 = Instance.new("Motor6D")
  69. o106 = Instance.new("Vector3Value")
  70. o107 = Instance.new("Motor6D")
  71. o111 = Instance.new("Vector3Value")
  72. o112 = Instance.new("Motor6D")
  73. o113 = Instance.new("Script")
  74. o117 = Instance.new("Vector3Value")
  75. o118 = Instance.new("Motor6D")
  76. o119 = Instance.new("Script")
  77. o120 = Instance.new("Script")
  78. o121 = Instance.new("Script")
  79. o122 = Instance.new("Script")
  80. o123 = Instance.new("Part")
  81. o124 = Instance.new("Part")
  82. o125 = Instance.new("Script")
  83. o126 = Instance.new("StringValue")
  84. o127 = Instance.new("StringValue")
  85. o128 = Instance.new("Animation")
  86. o129 = Instance.new("StringValue")
  87. o130 = Instance.new("StringValue")
  88. o131 = Instance.new("Animation")
  89. o132 = Instance.new("StringValue")
  90. o133 = Instance.new("Animation")
  91. o134 = Instance.new("StringValue")
  92. o135 = Instance.new("Animation")
  93. o136 = Instance.new("StringValue")
  94. o137 = Instance.new("Animation")
  95. o138 = Instance.new("StringValue")
  96. o139 = Instance.new("StringValue")
  97. o140 = Instance.new("Animation")
  98. o141 = Instance.new("StringValue")
  99. o142 = Instance.new("Animation")
  100. o143 = Instance.new("Script")
  101. o1.Name = "Shadow runner"
  102. o1.Parent = mas
  103. o2.Name = "Shadow"
  104. o2.Parent = o1
  105. o2.PrimaryPart = o3
  106. o3.Name = "HumanoidRootPart"
  107. o3.Parent = o2
  108. o3.Transparency = 1
  109. o3.Position = Vector3.new(-6.20944214, 2.32397389, -11.42136)
  110. o3.Rotation = Vector3.new(-180, -77.4799957, -180)
  111. o3.CanCollide = false
  112. o3.Size = Vector3.new(2, 2, 1)
  113. o3.CFrame = CFrame.new(-6.20944214, 2.32397389, -11.42136, -0.216782376, 0, -0.976219952, 0, 1, 0, 0.976219952, 0, -0.216782376)
  114. o3.Position = Vector3.new(-6.20944214, 2.32397389, -11.42136)
  115. o5.Parent = o2
  116. o5.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
  117. o5.Torso = o3
  118. o5.Health = 1000
  119. o5.MaxHealth = 1000
  120. o5.WalkSpeed = 25
  121. o7.Name = "Head"
  122. o7.Parent = o2
  123. o7.Material = Enum.Material.SmoothPlastic
  124. o7.BrickColor = BrickColor.new("Really black")
  125. o7.Position = Vector3.new(-6.20970821, 4.47397423, -11.4214191)
  126. o7.Rotation = Vector3.new(-180, -77.4799957, -180)
  127. o7.Size = Vector3.new(2, 1, 1)
  128. o7.CFrame = CFrame.new(-6.20970821, 4.47397423, -11.4214191, -0.216782376, 0, -0.976219952, 0, 1, 0, 0.976219952, 0, -0.216782376)
  129. o7.BottomSurface = Enum.SurfaceType.Smooth
  130. o7.TopSurface = Enum.SurfaceType.Smooth
  131. o7.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  132. o7.Position = Vector3.new(-6.20970821, 4.47397423, -11.4214191)
  133. o8.Parent = o7
  134. o8.Scale = Vector3.new(1.25, 1.25, 1.25)
  135. o14.Parent = o7
  136. o14.MeshId = "http://www.roblox.com/asset/?id=83001675"
  137. o14.Scale = Vector3.new(1.25, 1.25, 1.25)
  138. o14.MeshType = Enum.MeshType.FileMesh
  139. o15.Name = "Neck"
  140. o15.Parent = o7
  141. o15.C0 = CFrame.new(-4.17232513e-07, 0.834590554, 0.0607423484, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  142. o15.C1 = CFrame.new(0, -0.500000119, -0.000272244215, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  143. o15.Part0 = mas
  144. o15.Part1 = o7
  145. o16.Name = "GettingUp"
  146. o16.Parent = o7
  147. o16.SoundId = "rbxasset://sounds/action_get_up.mp3"
  148. o16.Volume = 0.64999997615814
  149. o17.Name = "Died"
  150. o17.Parent = o7
  151. o17.SoundId = "rbxasset://sounds/uuhhh.mp3"
  152. o17.Volume = 0.64999997615814
  153. o18.Name = "FreeFalling"
  154. o18.Parent = o7
  155. o18.SoundId = "rbxasset://sounds/action_falling.mp3"
  156. o18.Volume = 0.64999997615814
  157. o18.Looped = true
  158. o19.Name = "Jumping"
  159. o19.Parent = o7
  160. o19.SoundId = "rbxasset://sounds/action_jump.mp3"
  161. o19.Volume = 0.64999997615814
  162. o20.Name = "Landing"
  163. o20.Parent = o7
  164. o20.SoundId = "rbxasset://sounds/action_jump_land.mp3"
  165. o20.Volume = 0.64999997615814
  166. o21.Name = "Splash"
  167. o21.Parent = o7
  168. o21.SoundId = "rbxasset://sounds/impact_water.mp3"
  169. o21.Volume = 0.64999997615814
  170. o22.Name = "Running"
  171. o22.Parent = o7
  172. o22.Pitch = 1.8500000238419
  173. o22.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  174. o22.Volume = 0.64999997615814
  175. o22.Looped = true
  176. o23.Name = "Swimming"
  177. o23.Parent = o7
  178. o23.Pitch = 1.6000000238419
  179. o23.SoundId = "rbxasset://sounds/action_swim.mp3"
  180. o23.Volume = 0.64999997615814
  181. o23.Looped = true
  182. o24.Name = "Climbing"
  183. o24.Parent = o7
  184. o24.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  185. o24.Volume = 0.64999997615814
  186. o24.Looped = true
  187. o25.Parent = o7
  188. o25.C1 = CFrame.new(-0.519638062, -0.206021309, 0.0883045197, -0.216782376, 0, -0.976219952, 0, 1, 0, 0.976219952, 0, -0.216782376)
  189. o25.Part0 = o7
  190. o25.Part1 = o124
  191. o26.Parent = o7
  192. o26.C1 = CFrame.new(-0.43963623, -0.206021309, -0.291698456, -0.216782376, 0, -0.976219952, 0, 1, 0, 0.976219952, 0, -0.216782376)
  193. o26.Part0 = o7
  194. o26.Part1 = o123
  195. o27.Name = "Idle"
  196. o27.Parent = o7
  197. o27.SoundId = "rbxassetid://257345390"
  198. o27.Volume = 1
  199. o27.Looped = true
  200. o28.Parent = o2
  201. table.insert(cors,coroutine.create(function()
  202. wait()
  203. runDummyScript(function()
  204. local larm = script.Parent:FindFirstChild("HumanoidRootPart")
  205. local rarm = script.Parent:FindFirstChild("HumanoidRootPart")
  206.  
  207. function findNearestTorso(pos)
  208. local list = game.Workspace:children()
  209. local torso = nil
  210. local dist = 400000
  211. local temp = nil
  212. local human = nil
  213. local temp2 = nil
  214. for x = 1, #list do
  215. temp2 = list[x]
  216. if (temp2.className == "Model") and (temp2 ~= script.Parent) then
  217. temp = temp2:findFirstChild("HumanoidRootPart")
  218. human = temp2:findFirstChild("Humanoid")
  219. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  220. if (temp.Position - pos).magnitude < dist then
  221. torso = temp
  222. dist = (temp.Position - pos).magnitude
  223. end
  224. end
  225. end
  226. end
  227. return torso
  228. end
  229.  
  230.  
  231.  
  232.  
  233. while true do
  234. wait(math.random(1,5))
  235. local target = findNearestTorso(script.Parent.HumanoidRootPart.Position)
  236. if target ~= nil then
  237. script.Parent.Humanoid:MoveTo(target.Position, target)
  238. end
  239.  
  240. end
  241.  
  242. end,o28)
  243. end))
  244. o29.Parent = o2
  245. o29.HeadColor = BrickColor.new("Really black")
  246. o29.LeftArmColor = BrickColor.new("Really black")
  247. o29.LeftLegColor = BrickColor.new("Really black")
  248. o29.RightArmColor = BrickColor.new("Really black")
  249. o29.RightLegColor = BrickColor.new("Really black")
  250. o29.TorsoColor = BrickColor.new("Really black")
  251. o30.Name = "Health"
  252. o30.Parent = o2
  253. table.insert(cors,coroutine.create(function()
  254. wait()
  255. runDummyScript(function()
  256. --Responsible for regening a player's humanoid's health
  257.  
  258. -- declarations
  259. local Figure = script.Parent
  260. local Head = Figure:WaitForChild("Head")
  261. local Humanoid = Figure:WaitForChild("Humanoid")
  262. local regening = false
  263.  
  264. -- regeneration
  265. function regenHealth()
  266. if regening then return end
  267. regening = true
  268.  
  269. while Humanoid.Health < Humanoid.MaxHealth do
  270. local s = wait(1)
  271. local health = Humanoid.Health
  272. if health > 0 and health < Humanoid.MaxHealth then
  273. local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
  274. health = health + newHealthDelta
  275. Humanoid.Health = math.min(health,Humanoid.MaxHealth)
  276. end
  277. end
  278.  
  279. if Humanoid.Health > Humanoid.MaxHealth then
  280. Humanoid.Health = Humanoid.MaxHealth
  281. end
  282.  
  283. regening = false
  284. end
  285.  
  286. Humanoid.HealthChanged:connect(regenHealth)
  287.  
  288. end,o30)
  289. end))
  290. o31.Name = "Core"
  291. o31.Parent = o2
  292. table.insert(cors,coroutine.create(function()
  293. wait()
  294. runDummyScript(function()
  295. print("Hello world!")
  296.  
  297. Character = script.Parent
  298. Humanoid = Character.Humanoid
  299. Torso = Character.Torso
  300.  
  301. function OnDeath()
  302. print("Death")
  303. x=Character:GetChildren()
  304. for i=1,#x do
  305. if (x[i].className=="Tool") then
  306. x[i].Parent = nil
  307. end
  308. end
  309. mode = Instance.new("Model")
  310. mode.Name = ""
  311. mode.Parent = Workspace
  312. wait()
  313. Humanoid.Parent = nil
  314. THIS = script.Cleaner:clone()
  315. THIS.Parent = mode
  316. THIS.Disabled = false
  317. bland=Instance.new("Humanoid")
  318. bland.Health=0
  319. bland.MaxHealth=0
  320. bland.Parent=mode
  321. --bland.Name = "Ragdoll"
  322. x=Character:GetChildren()
  323. for i=1,#x do
  324. if (x[i].className=="Hat") then
  325. x[i].Handle.Anchored = true
  326. end
  327. if (x[i].className =="Part") then
  328. x[i].Anchored = true
  329. end
  330. end
  331. if Torso then
  332. --Torso.Velocity = Vector3.new(0, 0, 0)
  333. --Torso.RotVelocity = Vector3.new(0, 0, 0)
  334. zam=Torso:Clone()
  335. zam.Parent=mode
  336. zam.Elasticity = 0
  337. zam.Friction = 1
  338. x=Character:GetChildren()
  339. for i=1,#x do
  340. if ((x[i].Name=="Shirt") or (x[i].Name=="Pants") or (x[i].className=="CharacterMesh") or (x[i].className=="Hat") or (x[i].className=="Decal") or (x[i].className=="ShirtGraphic") or (x[i].className=="Model")) then
  341. local zor=x[i]:Clone()
  342. zor.Parent=mode
  343. end
  344. if x[i].Name=="Head" then
  345. --x[i].Velocity = Vector3.new(0, 0, 0)
  346. --x[i].RotVelocity = Vector3.new(0, 0, 0)
  347. local zem=x[i]:Clone()
  348. zem.Parent=mode
  349. zem.Name="Head"
  350. zem.Elasticity = 0
  351. zem.Friction = 1
  352. local Neck = Instance.new("Weld")
  353. Neck.Name = "Neck"
  354. Neck.Part0 = zam
  355. Neck.Part1 = zem
  356. Neck.C0 = CFrame.new(0, 1.5, 0)
  357. Neck.C1 = CFrame.new()
  358. Neck.Parent = zam
  359. end
  360. if x[i].Name=="Right Arm" then
  361. --x[i].Velocity = Vector3.new(0, 0, 0)
  362. --x[i].RotVelocity = Vector3.new(0, 0, 0)
  363. local Limb=x[i]:Clone()
  364. Limb.Parent=mode
  365. Limb.CFrame = zam.CFrame * CFrame.new(1.5, 0, 0)
  366. Limb.Elasticity = 0
  367. Limb.Friction = 1
  368. local Joint = Instance.new("Rotate")
  369. Joint.Name = "RightShoulder"
  370. Joint.Part0 = zam
  371. Joint.Part1 = Limb
  372. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  373. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  374. Joint.Parent = zam
  375.  
  376. local B = Instance.new("Part")
  377. B.TopSurface = 0
  378. B.BottomSurface = 0
  379. B.Elasticity = 0
  380. B.Friction = 1
  381. B.formFactor = "Symmetric"
  382. B.Size = Vector3.new(1, 1, 1)
  383. B.Transparency = 1
  384. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  385. B.Parent = mode
  386. local W = Instance.new("Weld")
  387. W.Part0 = Limb
  388. W.Part1 = B
  389. W.C0 = CFrame.new(0, -0.5, 0)
  390. W.Parent = Limb
  391.  
  392. end
  393. if x[i].Name=="Left Arm" then
  394. --x[i].Velocity = Vector3.new(0, 0, 0)
  395. --x[i].RotVelocity = Vector3.new(0, 0, 0)
  396. local Limb=x[i]:Clone()
  397. Limb.Parent=mode
  398. Limb.CFrame = zam.CFrame * CFrame.new(-1.5, 0, 0)
  399. Limb.Elasticity = 0
  400. Limb.Friction = 1
  401. local Joint = Instance.new("Rotate")
  402. Joint.Name = "LeftShoulder"
  403. Joint.Part0 = zam
  404. Joint.Part1 = Limb
  405. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  406. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  407. Joint.Parent = zam
  408.  
  409. local B = Instance.new("Part")
  410. B.TopSurface = 0
  411. B.BottomSurface = 0
  412. B.Elasticity = 0
  413. B.Friction = 1
  414. B.formFactor = "Symmetric"
  415. B.Size = Vector3.new(1, 1, 1)
  416. B.Transparency = 1
  417. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  418. B.Parent = mode
  419. local W = Instance.new("Weld")
  420. W.Part0 = Limb
  421. W.Part1 = B
  422. W.C0 = CFrame.new(0, -0.5, 0)
  423. W.Parent = Limb
  424.  
  425. end
  426. if x[i].Name=="Right Leg" then
  427. --x[i].Velocity = Vector3.new(0, 0, 0)
  428. --x[i].RotVelocity = Vector3.new(0, 0, 0)
  429. local Limb=x[i]:Clone()
  430. Limb.Parent=mode
  431. Limb.CFrame = zam.CFrame * CFrame.new(0.5, -2, 0)
  432. Limb.Elasticity = 0
  433. Limb.Friction = 1
  434. local Joint = Instance.new("Rotate")
  435. Joint.Name = "RightHip"
  436. Joint.Part0 = zam
  437. Joint.Part1 = Limb
  438. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  439. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  440. Joint.Parent = zam
  441.  
  442. local B = Instance.new("Part")
  443. B.TopSurface = 0
  444. B.BottomSurface = 0
  445. B.Elasticity = 0
  446. B.Friction = 1
  447. B.formFactor = "Symmetric"
  448. B.Size = Vector3.new(1, 1, 1)
  449. B.Transparency = 1
  450. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  451. B.Parent = mode
  452. local W = Instance.new("Weld")
  453. W.Part0 = Limb
  454. W.Part1 = B
  455. W.C0 = CFrame.new(0, -0.5, 0)
  456. W.Parent = Limb
  457.  
  458. end
  459. if x[i].Name=="Left Leg" then
  460. --x[i].Velocity = Vector3.new(0, 0, 0)
  461. --x[i].RotVelocity = Vector3.new(0, 0, 0)
  462. local Limb=x[i]:Clone()
  463. Limb.Parent=mode
  464. Limb.CFrame = zam.CFrame * CFrame.new(-0.5, -2, 0)
  465. Limb.Elasticity = 0
  466. Limb.Friction = 1
  467. local Joint = Instance.new("Rotate")
  468. Joint.Name = "LeftHip"
  469. Joint.Part0 = zam
  470. Joint.Part1 = Limb
  471. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  472. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  473. Joint.Parent = zam
  474.  
  475. local B = Instance.new("Part")
  476. B.TopSurface = 0
  477. B.BottomSurface = 0
  478. B.Elasticity = 0
  479. B.Friction = 1
  480. B.formFactor = "Symmetric"
  481. B.Size = Vector3.new(1, 1, 1)
  482. B.Transparency = 1
  483. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  484. B.Parent = mode
  485. local W = Instance.new("Weld")
  486. W.Part0 = Limb
  487. W.Part1 = B
  488. W.C0 = CFrame.new(0, -0.5, 0)
  489. W.Parent = Limb
  490.  
  491. end
  492. end
  493.  
  494. local Bar = Instance.new("Part")
  495. Bar.TopSurface = 0
  496. Bar.BottomSurface = 0
  497. Bar.Elasticity = 0
  498. Bar.Friction = 1
  499. Bar.formFactor = "Symmetric"
  500. Bar.Size = Vector3.new(1, 1, 1)
  501. Bar.Transparency = 1
  502. Bar.CFrame = zam.CFrame * CFrame.new(0, 0.5, 0)
  503. Bar.Parent = mode
  504. local Weld = Instance.new("Weld")
  505. Weld.Part0 = zam
  506. Weld.Part1 = Bar
  507. Weld.C0 = CFrame.new(0, 0.5, 0)
  508. Weld.Parent = zam
  509. end
  510. wait()
  511. Character:remove()
  512. mode:FindFirstChild("Head").Velocity = Vector3.new(0,0,0)
  513. mode:FindFirstChild("Left Arm").Velocity = Vector3.new(0,0,0)
  514. mode:FindFirstChild("Left Leg").Velocity = Vector3.new(0,0,0)
  515. mode:FindFirstChild("Right Arm").Velocity = Vector3.new(0,0,0)
  516. mode:FindFirstChild("Right Leg").Velocity = Vector3.new(0,0,0)
  517. mode:FindFirstChild("Torso").Velocity = Vector3.new(0,0,0)
  518. x=mode:GetChildren()
  519. for i=1,#x do
  520. if (x[i].className=="Hat") then
  521. if x[i]:findFirstChild("Handle") then
  522. x[i].Handle.Anchored = false
  523. end
  524. end
  525. if (x[i].className =="Part") then
  526. x[i].Anchored = false
  527. end
  528. end
  529. local b = Instance.new("BodyPosition")
  530. b.maxForce = Vector3.new(0, 3000, 0)
  531. b.position = mode:findFirstChild("Torso").Position - Vector3.new(0, 25, 0)
  532. b.Parent = mode:findFirstChild("Torso")
  533. wait(5)
  534. for i=1,#x do
  535. if (x[i].className=="Hat") then
  536. if x[i]:findFirstChild("Handle") then
  537. x[i].Handle.Anchored = true
  538. end
  539. end
  540. if (x[i].className =="Part") then
  541. x[i].Anchored = true
  542. end
  543. end
  544. end
  545.  
  546. Humanoid.Died:connect(OnDeath)
  547. end,o31)
  548. end))
  549. o32.Name = "Cleaner"
  550. o32.Parent = o31
  551. o32.Disabled = true
  552. table.insert(cors,coroutine.create(function()
  553. wait()
  554. runDummyScript(function()
  555. wait(30) -- removes the raggy in 10 seconds.
  556. script.Parent:Destroy()
  557. end,o32)
  558. end))
  559. o33.Name = "Sound"
  560. o33.Parent = o2
  561. table.insert(cors,coroutine.create(function()
  562. wait()
  563. runDummyScript(function()
  564. --[[
  565. Author: @spotco
  566. This script creates sounds which are placed under the character head.
  567. These sounds are used by the "LocalSound" script.
  568.  
  569. To modify this script, copy it to your "StarterPlayer/StarterCharacterScripts" folder keeping the same script name ("Sound").
  570. The default Sound script loaded for every character will then be replaced with your copy of the script.
  571. ]]--
  572.  
  573. function CreateNewSound(name, id, looped, pitch, parent)
  574. local sound = Instance.new("Sound")
  575. sound.SoundId = id
  576. sound.Name = name
  577. sound.archivable = false
  578. sound.Parent = parent
  579. sound.Pitch = pitch
  580. sound.Looped = looped
  581.  
  582. sound.MinDistance = 5
  583. sound.MaxDistance = 150
  584. sound.Volume = 0.65
  585.  
  586. return sound
  587. end
  588.  
  589. local head = script.Parent:FindFirstChild("Head")
  590. if head == nil then
  591. error("Sound script parent has no child Head.")
  592. return
  593. end
  594.  
  595.  
  596. CreateNewSound("GettingUp", "rbxasset://sounds/action_get_up.mp3", false, 1, head)
  597. CreateNewSound("Died", "rbxasset://sounds/uuhhh.mp3", false, 1, head)
  598. CreateNewSound("FreeFalling", "rbxasset://sounds/action_falling.mp3", true, 1, head)
  599. CreateNewSound("Jumping", "rbxasset://sounds/action_jump.mp3", false, 1, head)
  600. CreateNewSound("Landing", "rbxasset://sounds/action_jump_land.mp3", false, 1, head)
  601. CreateNewSound("Splash", "rbxasset://sounds/impact_water.mp3", false, 1, head)
  602. CreateNewSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1.85, head)
  603. CreateNewSound("Swimming", "rbxasset://sounds/action_swim.mp3", true, 1.6, head)
  604. CreateNewSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1, head)
  605. end,o33)
  606. end))
  607. o34.Name = "LocalSound"
  608. o34.Parent = o33
  609. table.insert(cors,coroutine.create(function()
  610. wait()
  611. runDummyScript(function()
  612. --[[
  613. Author: @spotco
  614. This script runs locally for the player of the given humanoid.
  615. This script triggers humanoid sound play/pause actions locally.
  616.  
  617. The Playing/TimePosition properties of Sound objects bypass FilteringEnabled, so this triggers the sound
  618. immediately for the player and is replicated to all other players.
  619.  
  620. This script is optimized to reduce network traffic through minimizing the amount of property replication.
  621. ]]--
  622.  
  623. --All sounds are referenced by this ID
  624. local SFX = {
  625. Died = 0;
  626. Running = 1;
  627. Swimming = 2;
  628. Climbing = 3,
  629. Jumping = 4;
  630. GettingUp = 5;
  631. FreeFalling = 6;
  632. FallingDown = 7;
  633. Landing = 8;
  634. Splash = 9;
  635. }
  636.  
  637. local Humanoid = nil
  638. local Head = nil
  639.  
  640. --SFX ID to Sound object
  641. local Sounds = {}
  642.  
  643. do
  644. local Figure = script.Parent.Parent
  645. Head = Figure:WaitForChild("Head")
  646. while not Humanoid do
  647. for _,NewHumanoid in pairs(Figure:GetChildren()) do
  648. if NewHumanoid:IsA("Humanoid") then
  649. Humanoid = NewHumanoid
  650. break
  651. end
  652. end
  653. Figure.ChildAdded:wait()
  654. end
  655.  
  656. Sounds[SFX.Died] = Head:WaitForChild("Died")
  657. Sounds[SFX.Running] = Head:WaitForChild("Running")
  658. Sounds[SFX.Swimming] = Head:WaitForChild("Swimming")
  659. Sounds[SFX.Climbing] = Head:WaitForChild("Climbing")
  660. Sounds[SFX.Jumping] = Head:WaitForChild("Jumping")
  661. Sounds[SFX.GettingUp] = Head:WaitForChild("GettingUp")
  662. Sounds[SFX.FreeFalling] = Head:WaitForChild("FreeFalling")
  663. Sounds[SFX.Landing] = Head:WaitForChild("Landing")
  664. Sounds[SFX.Splash] = Head:WaitForChild("Splash")
  665. end
  666.  
  667. local Util
  668. Util = {
  669.  
  670. --Define linear relationship between (pt1x,pt2x) and (pt2x,pt2y). Evaluate this at x.
  671. YForLineGivenXAndTwoPts = function(x,pt1x,pt1y,pt2x,pt2y)
  672. --(y - y1)/(x - x1) = m
  673. local m = (pt1y - pt2y) / (pt1x - pt2x)
  674. --float b = pt1.y - m * pt1.x;
  675. local b = (pt1y - m * pt1x)
  676. return m * x + b
  677. end;
  678.  
  679. --Clamps the value of "val" between the "min" and "max"
  680. Clamp = function(val,min,max)
  681. return math.min(max,math.max(min,val))
  682. end;
  683.  
  684. --Gets the horizontal (x,z) velocity magnitude of the given part
  685. HorizontalSpeed = function(Head)
  686. local hVel = Head.Velocity + Vector3.new(0,-Head.Velocity.Y,0)
  687. return hVel.magnitude
  688. end;
  689.  
  690. --Gets the vertical (y) velocity magnitude of the given part
  691. VerticalSpeed = function(Head)
  692. return math.abs(Head.Velocity.Y)
  693. end;
  694.  
  695. --Setting Playing/TimePosition values directly result in less network traffic than Play/Pause/Resume/Stop
  696. --If these properties are enabled, use them.
  697. Play = function(sound)
  698. if sound.TimePosition ~= 0 then
  699. sound.TimePosition = 0
  700. end
  701. if not sound.IsPlaying then
  702. sound.Playing = true
  703. end
  704. end;
  705. Pause = function(sound)
  706. if sound.IsPlaying then
  707. sound.Playing = false
  708. end
  709. end;
  710. Resume = function(sound)
  711. if not sound.IsPlaying then
  712. sound.Playing = true
  713. end
  714. end;
  715. Stop = function(sound)
  716. if sound.IsPlaying then
  717. sound.Playing = false
  718. end
  719. if sound.TimePosition ~= 0 then
  720. sound.TimePosition = 0
  721. end
  722. end;
  723. }
  724.  
  725. do
  726. -- List of all active Looped sounds
  727. local playingLoopedSounds = {}
  728.  
  729. -- Last seen Enum.HumanoidStateType
  730. local activeState = nil
  731.  
  732. -- Verify and set that "sound" is in "playingLoopedSounds".
  733. function setSoundInPlayingLoopedSounds(sound)
  734. for i=1, #playingLoopedSounds do
  735. if playingLoopedSounds[i] == sound then
  736. return
  737. end
  738. end
  739. table.insert(playingLoopedSounds,sound)
  740. end
  741.  
  742. -- Stop all active looped sounds except parameter "except". If "except" is not passed, all looped sounds will be stopped.
  743. function stopPlayingLoopedSoundsExcept(except)
  744. for i=#playingLoopedSounds,1,-1 do
  745. if playingLoopedSounds[i] ~= except then
  746. Util.Pause(playingLoopedSounds[i])
  747. table.remove(playingLoopedSounds,i)
  748. end
  749. end
  750. end
  751.  
  752. -- Table of Enum.HumanoidStateType to handling function
  753. local stateUpdateHandler = {
  754. [Enum.HumanoidStateType.Dead] = function()
  755. stopPlayingLoopedSoundsExcept()
  756. local sound = Sounds[SFX.Died]
  757. Util.Play(sound)
  758. end;
  759.  
  760. [Enum.HumanoidStateType.RunningNoPhysics] = function()
  761. stateUpdated(Enum.HumanoidStateType.Running)
  762. end;
  763.  
  764. [Enum.HumanoidStateType.Running] = function()
  765. local sound = Sounds[SFX.Running]
  766. stopPlayingLoopedSoundsExcept(sound)
  767.  
  768. if Util.HorizontalSpeed(Head) > 0.5 then
  769. Util.Resume(sound)
  770. setSoundInPlayingLoopedSounds(sound)
  771. else
  772. stopPlayingLoopedSoundsExcept()
  773. end
  774. end;
  775.  
  776. [Enum.HumanoidStateType.Swimming] = function()
  777. if activeState ~= Enum.HumanoidStateType.Swimming and Util.VerticalSpeed(Head) > 0.1 then
  778. local splashSound = Sounds[SFX.Splash]
  779. splashSound.Volume = Util.Clamp(
  780. Util.YForLineGivenXAndTwoPts(
  781. Util.VerticalSpeed(Head),
  782. 100, 0.28,
  783. 350, 1),
  784. 0,1)
  785. Util.Play(splashSound)
  786. end
  787.  
  788. do
  789. local sound = Sounds[SFX.Swimming]
  790. stopPlayingLoopedSoundsExcept(sound)
  791. Util.Resume(sound)
  792. setSoundInPlayingLoopedSounds(sound)
  793. end
  794. end;
  795.  
  796. [Enum.HumanoidStateType.Climbing] = function()
  797. local sound = Sounds[SFX.Climbing]
  798. if Util.VerticalSpeed(Head) > 0.1 then
  799. Util.Resume(sound)
  800. stopPlayingLoopedSoundsExcept(sound)
  801. else
  802. stopPlayingLoopedSoundsExcept()
  803. end
  804. setSoundInPlayingLoopedSounds(sound)
  805. end;
  806.  
  807. [Enum.HumanoidStateType.Jumping] = function()
  808. if activeState == Enum.HumanoidStateType.Jumping then
  809. return
  810. end
  811. stopPlayingLoopedSoundsExcept()
  812. local sound = Sounds[SFX.Jumping]
  813. Util.Play(sound)
  814. end;
  815.  
  816. [Enum.HumanoidStateType.GettingUp] = function()
  817. stopPlayingLoopedSoundsExcept()
  818. local sound = Sounds[SFX.GettingUp]
  819. Util.Play(sound)
  820. end;
  821.  
  822. [Enum.HumanoidStateType.Freefall] = function()
  823. if activeState == Enum.HumanoidStateType.Freefall then
  824. return
  825. end
  826. local sound = Sounds[SFX.FreeFalling]
  827. sound.Volume = 0
  828. stopPlayingLoopedSoundsExcept()
  829. end;
  830.  
  831. [Enum.HumanoidStateType.FallingDown] = function()
  832. stopPlayingLoopedSoundsExcept()
  833. end;
  834.  
  835. [Enum.HumanoidStateType.Landed] = function()
  836. stopPlayingLoopedSoundsExcept()
  837. if Util.VerticalSpeed(Head) > 75 then
  838. local landingSound = Sounds[SFX.Landing]
  839. landingSound.Volume = Util.Clamp(
  840. Util.YForLineGivenXAndTwoPts(
  841. Util.VerticalSpeed(Head),
  842. 50, 0,
  843. 100, 1),
  844. 0,1)
  845. Util.Play(landingSound)
  846. end
  847. end
  848. }
  849.  
  850. -- Handle state event fired or OnChange fired
  851. function stateUpdated(state)
  852. if stateUpdateHandler[state] ~= nil then
  853. stateUpdateHandler[state]()
  854. end
  855. activeState = state
  856. end
  857.  
  858. Humanoid.Died:connect( function() stateUpdated(Enum.HumanoidStateType.Dead) end)
  859. Humanoid.Running:connect( function() stateUpdated(Enum.HumanoidStateType.Running) end)
  860. Humanoid.Swimming:connect( function() stateUpdated(Enum.HumanoidStateType.Swimming) end)
  861. Humanoid.Climbing:connect( function() stateUpdated(Enum.HumanoidStateType.Climbing) end)
  862. Humanoid.Jumping:connect( function() stateUpdated(Enum.HumanoidStateType.Jumping) end)
  863. Humanoid.GettingUp:connect( function() stateUpdated(Enum.HumanoidStateType.GettingUp) end)
  864. Humanoid.FreeFalling:connect( function() stateUpdated(Enum.HumanoidStateType.Freefall) end)
  865. Humanoid.FallingDown:connect( function() stateUpdated(Enum.HumanoidStateType.FallingDown) end)
  866.  
  867. -- required for proper handling of Landed event
  868. Humanoid.StateChanged:connect(function(old, new)
  869. stateUpdated(new)
  870. end)
  871.  
  872.  
  873. function onUpdate(stepDeltaSeconds, tickSpeedSeconds)
  874. local stepScale = stepDeltaSeconds / tickSpeedSeconds
  875. do
  876. local sound = Sounds[SFX.FreeFalling]
  877. if activeState == Enum.HumanoidStateType.Freefall then
  878. if Head.Velocity.Y < 0 and Util.VerticalSpeed(Head) > 75 then
  879. Util.Resume(sound)
  880.  
  881. --Volume takes 1.1 seconds to go from volume 0 to 1
  882. local ANIMATION_LENGTH_SECONDS = 1.1
  883.  
  884. local normalizedIncrement = tickSpeedSeconds / ANIMATION_LENGTH_SECONDS
  885. sound.Volume = Util.Clamp(sound.Volume + normalizedIncrement * stepScale, 0, 1)
  886. else
  887. sound.Volume = 0
  888. end
  889. else
  890. Util.Pause(sound)
  891. end
  892. end
  893.  
  894. do
  895. local sound = Sounds[SFX.Running]
  896. if activeState == Enum.HumanoidStateType.Running then
  897. if Util.HorizontalSpeed(Head) < 0.5 then
  898. Util.Pause(sound)
  899. end
  900. end
  901. end
  902. end
  903.  
  904. local lastTick = tick()
  905. local TICK_SPEED_SECONDS = 0.25
  906. while true do
  907. onUpdate(tick() - lastTick,TICK_SPEED_SECONDS)
  908. lastTick = tick()
  909. wait(TICK_SPEED_SECONDS)
  910. end
  911. end
  912.  
  913. end,o34)
  914. end))
  915. o35.Name = "Respawn"
  916. o35.Parent = o2
  917. table.insert(cors,coroutine.create(function()
  918. wait()
  919. runDummyScript(function()
  920. name="Humanoid"
  921.  
  922. robo=script.Parent:clone()
  923.  
  924. while true do
  925. wait(30)
  926. if script.Parent.Humanoid.Health<1 then
  927. robot=robo:clone()
  928. robot.Parent=script.Parent.Parent
  929. robot:makeJoints()
  930. script.Parent:remove()
  931. end
  932. end
  933.  
  934.  
  935.  
  936.  
  937. end,o35)
  938. end))
  939. o38.Name = "OriginalSize"
  940. o38.Parent = mas
  941. o38.Value = Vector3.new(0.804975927, 0.45631969, 1.21525145)
  942. o39.Name = "LeftAnkle"
  943. o39.Parent = mas
  944. o39.C0 = CFrame.new(-0.0572988987, -0.554775834, 0.00460058777, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  945. o39.C1 = CFrame.new(-0.0572988093, -0.0541849136, 0.102052271, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  946. o39.Part0 = mas
  947. o39.Part1 = mas
  948. o48.Name = "OriginalSize"
  949. o48.Parent = mas
  950. o48.Value = Vector3.new(1.68052888, 0.508752942, 1.01567388)
  951. o49.Name = "Root"
  952. o49.Parent = mas
  953. o49.C1 = CFrame.new(-5.66244125e-07, 0.0325828269, 0.0487938523, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  954. o49.Part0 = o3
  955. o49.Part1 = mas
  956. o60.Name = "OriginalSize"
  957. o60.Parent = mas
  958. o60.Value = Vector3.new(2.03200006, 1.86928844, 1.12989664)
  959. o61.Name = "Waist"
  960. o61.Parent = mas
  961. o61.C0 = CFrame.new(-5.66244125e-07, 0.432582825, 0.0487938523, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  962. o61.C1 = CFrame.new(-4.17232513e-07, -0.415409416, 0.0607423484, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  963. o61.Part0 = mas
  964. o61.Part1 = mas
  965. o66.Name = "OriginalSize"
  966. o66.Parent = mas
  967. o66.Value = Vector3.new(0.675612688, 1.12489867, 0.826949)
  968. o67.Name = "LeftShoulder"
  969. o67.Parent = mas
  970. o67.C0 = CFrame.new(-1.24989152, 0.584590554, 0.0607423484, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  971. o67.C1 = CFrame.new(0.0625219345, 0.288986444, -0.0245017558, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  972. o67.Part0 = mas
  973. o67.Part1 = mas
  974. o71.Name = "OriginalSize"
  975. o71.Parent = mas
  976. o71.Value = Vector3.new(0.678933978, 1.34023976, 0.838257849)
  977. o72.Name = "RightHip"
  978. o72.Parent = mas
  979. o72.C0 = CFrame.new(0.499999434, -0.317417175, 0.0487938523, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  980. o72.C1 = CFrame.new(0.0572995543, 0.406759053, 0.0292846859, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  981. o72.Part0 = mas
  982. o72.Part1 = mas
  983. o77.Name = "OriginalSize"
  984. o77.Parent = mas
  985. o77.Value = Vector3.new(0.675612688, 1.12489867, 0.826949239)
  986. o78.Name = "RightShoulder"
  987. o78.Parent = mas
  988. o78.C0 = CFrame.new(1.24997997, 0.584590554, 0.0607423484, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  989. o78.C1 = CFrame.new(-0.0624326468, 0.288986444, -0.0245021135, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  990. o78.Part0 = mas
  991. o78.Part1 = mas
  992. o82.Name = "OriginalSize"
  993. o82.Parent = mas
  994. o82.Value = Vector3.new(0.827857256, 0.925159216, 0.877025485)
  995. o83.Name = "RightElbow"
  996. o83.Parent = mas
  997. o83.C0 = CFrame.new(0.187587023, -0.361013532, -0.0245021135, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  998. o83.C1 = CFrame.new(0.0363556147, 0.403800189, -0.00020223856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  999. o83.Part0 = mas
  1000. o83.Part1 = mas
  1001. o87.Name = "OriginalSize"
  1002. o87.Parent = mas
  1003. o87.Value = Vector3.new(0.722899377, 0.919740558, 0.897220731)
  1004. o88.Name = "RightKnee"
  1005. o88.Parent = mas
  1006. o88.C0 = CFrame.new(0.0572995543, -0.393240929, 0.029328391, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1007. o88.C1 = CFrame.new(0.0572987497, 0.445221305, 0.00464349939, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1008. o88.Part0 = mas
  1009. o88.Part1 = mas
  1010. o92.Name = "OriginalSize"
  1011. o92.Parent = mas
  1012. o92.Value = Vector3.new(0.678933918, 1.34023976, 0.83825773)
  1013. o93.Name = "LeftHip"
  1014. o93.Parent = mas
  1015. o93.C0 = CFrame.new(-0.500000596, -0.317417175, 0.0487938523, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1016. o93.C1 = CFrame.new(-0.0572995245, 0.406759053, 0.0292848647, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1017. o93.Part0 = mas
  1018. o93.Part1 = mas
  1019. o97.Name = "OriginalSize"
  1020. o97.Parent = mas
  1021. o97.Value = Vector3.new(0.722899318, 0.919740438, 0.897220731)
  1022. o98.Name = "LeftKnee"
  1023. o98.Parent = mas
  1024. o98.C0 = CFrame.new(-0.0572995245, -0.393240929, 0.0292848647, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1025. o98.C1 = CFrame.new(-0.0572987199, 0.445221424, 0.00459977984, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1026. o98.Part0 = mas
  1027. o98.Part1 = mas
  1028. o101.Name = "OriginalSize"
  1029. o101.Parent = mas
  1030. o101.Value = Vector3.new(0.804975271, 0.456319809, 1.21525121)
  1031. o102.Name = "RightAnkle"
  1032. o102.Parent = mas
  1033. o102.C0 = CFrame.new(0.0572987497, -0.554778814, 0.00469824811, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1034. o102.C1 = CFrame.new(0.0572986603, -0.0541877747, 0.102150455, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1035. o102.Part0 = mas
  1036. o102.Part1 = mas
  1037. o106.Name = "OriginalSize"
  1038. o106.Parent = mas
  1039. o106.Value = Vector3.new(0.827857256, 0.925159276, 0.877025366)
  1040. o107.Name = "LeftElbow"
  1041. o107.Parent = mas
  1042. o107.C0 = CFrame.new(-0.187108159, -0.361013532, -0.0245017558, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1043. o107.C1 = CFrame.new(-0.0358767509, 0.40380016, -0.000202059746, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1044. o107.Part0 = mas
  1045. o107.Part1 = mas
  1046. o111.Name = "OriginalSize"
  1047. o111.Parent = mas
  1048. o111.Value = Vector3.new(0.775964022, 0.955060005, 0.760477781)
  1049. o112.Name = "LeftWrist"
  1050. o112.Parent = mas
  1051. o112.C0 = CFrame.new(-0.0358767509, -0.396199822, -0.000202059746, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1052. o112.C1 = CFrame.new(0.0106925964, 0.110724702, -0.0063508749, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1053. o112.Part0 = mas
  1054. o112.Part1 = mas
  1055. o113.Name = "Damage Script"
  1056. o113.Parent = mas
  1057. table.insert(cors,coroutine.create(function()
  1058. wait()
  1059. runDummyScript(function()
  1060. function onTouched(hit)
  1061. local human = hit.Parent:findFirstChild("Humanoid")
  1062. if (human ~= nil) then
  1063. human.Health = human.Health - 50 -- Change the amount to change the damage.
  1064. end
  1065. end
  1066. script.Parent.Touched:connect(onTouched)
  1067. end,o113)
  1068. end))
  1069. o117.Name = "OriginalSize"
  1070. o117.Parent = mas
  1071. o117.Value = Vector3.new(0.775964022, 0.955060005, 0.760477781)
  1072. o118.Name = "RightWrist"
  1073. o118.Parent = mas
  1074. o118.C0 = CFrame.new(0.0363556147, -0.396199793, -0.00020223856, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1075. o118.C1 = CFrame.new(-0.0102137327, 0.110724702, -0.00635111332, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1076. o118.Part0 = mas
  1077. o118.Part1 = mas
  1078. o119.Name = "Damage Script"
  1079. o119.Parent = mas
  1080. table.insert(cors,coroutine.create(function()
  1081. wait()
  1082. runDummyScript(function()
  1083. function onTouched(hit)
  1084. local human = hit.Parent:findFirstChild("Humanoid")
  1085. if (human ~= nil) then
  1086. human.Health = human.Health - 50 -- Change the amount to change the damage.
  1087. end
  1088. end
  1089. script.Parent.Touched:connect(onTouched)
  1090. end,o119)
  1091. end))
  1092. o120.Name = "Core"
  1093. o120.Parent = o2
  1094. table.insert(cors,coroutine.create(function()
  1095. wait()
  1096. runDummyScript(function()
  1097. print("Hello world!")
  1098.  
  1099. Character = script.Parent
  1100. Humanoid = Character.Humanoid
  1101. Torso = Character.Torso
  1102.  
  1103. function OnDeath()
  1104. print("Death")
  1105. x=Character:GetChildren()
  1106. for i=1,#x do
  1107. if (x[i].className=="Tool") then
  1108. x[i].Parent = nil
  1109. end
  1110. end
  1111. mode = Instance.new("Model")
  1112. mode.Name = ""
  1113. mode.Parent = Workspace
  1114. wait()
  1115. Humanoid.Parent = nil
  1116. THIS = script.Cleaner:clone()
  1117. THIS.Parent = mode
  1118. THIS.Disabled = false
  1119. bland=Instance.new("Humanoid")
  1120. bland.Health=0
  1121. bland.MaxHealth=0
  1122. bland.Parent=mode
  1123. --bland.Name = "Ragdoll"
  1124. x=Character:GetChildren()
  1125. for i=1,#x do
  1126. if (x[i].className=="Hat") then
  1127. x[i].Handle.Anchored = true
  1128. end
  1129. if (x[i].className =="Part") then
  1130. x[i].Anchored = true
  1131. end
  1132. end
  1133. if Torso then
  1134. --Torso.Velocity = Vector3.new(0, 0, 0)
  1135. --Torso.RotVelocity = Vector3.new(0, 0, 0)
  1136. zam=Torso:Clone()
  1137. zam.Parent=mode
  1138. zam.Elasticity = 0
  1139. zam.Friction = 1
  1140. x=Character:GetChildren()
  1141. for i=1,#x do
  1142. if ((x[i].Name=="Shirt") or (x[i].Name=="Pants") or (x[i].className=="CharacterMesh") or (x[i].className=="Hat") or (x[i].className=="Decal") or (x[i].className=="ShirtGraphic") or (x[i].className=="Model")) then
  1143. local zor=x[i]:Clone()
  1144. zor.Parent=mode
  1145. end
  1146. if x[i].Name=="Head" then
  1147. --x[i].Velocity = Vector3.new(0, 0, 0)
  1148. --x[i].RotVelocity = Vector3.new(0, 0, 0)
  1149. local zem=x[i]:Clone()
  1150. zem.Parent=mode
  1151. zem.Name="Head"
  1152. zem.Elasticity = 0
  1153. zem.Friction = 1
  1154. local Neck = Instance.new("Weld")
  1155. Neck.Name = "Neck"
  1156. Neck.Part0 = zam
  1157. Neck.Part1 = zem
  1158. Neck.C0 = CFrame.new(0, 1.5, 0)
  1159. Neck.C1 = CFrame.new()
  1160. Neck.Parent = zam
  1161. end
  1162. if x[i].Name=="Right Arm" then
  1163. --x[i].Velocity = Vector3.new(0, 0, 0)
  1164. --x[i].RotVelocity = Vector3.new(0, 0, 0)
  1165. local Limb=x[i]:Clone()
  1166. Limb.Parent=mode
  1167. Limb.CFrame = zam.CFrame * CFrame.new(1.5, 0, 0)
  1168. Limb.Elasticity = 0
  1169. Limb.Friction = 1
  1170. local Joint = Instance.new("Rotate")
  1171. Joint.Name = "RightShoulder"
  1172. Joint.Part0 = zam
  1173. Joint.Part1 = Limb
  1174. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1175. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1176. Joint.Parent = zam
  1177.  
  1178. local B = Instance.new("Part")
  1179. B.TopSurface = 0
  1180. B.BottomSurface = 0
  1181. B.Elasticity = 0
  1182. B.Friction = 1
  1183. B.formFactor = "Symmetric"
  1184. B.Size = Vector3.new(1, 1, 1)
  1185. B.Transparency = 1
  1186. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  1187. B.Parent = mode
  1188. local W = Instance.new("Weld")
  1189. W.Part0 = Limb
  1190. W.Part1 = B
  1191. W.C0 = CFrame.new(0, -0.5, 0)
  1192. W.Parent = Limb
  1193.  
  1194. end
  1195. if x[i].Name=="Left Arm" then
  1196. --x[i].Velocity = Vector3.new(0, 0, 0)
  1197. --x[i].RotVelocity = Vector3.new(0, 0, 0)
  1198. local Limb=x[i]:Clone()
  1199. Limb.Parent=mode
  1200. Limb.CFrame = zam.CFrame * CFrame.new(-1.5, 0, 0)
  1201. Limb.Elasticity = 0
  1202. Limb.Friction = 1
  1203. local Joint = Instance.new("Rotate")
  1204. Joint.Name = "LeftShoulder"
  1205. Joint.Part0 = zam
  1206. Joint.Part1 = Limb
  1207. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1208. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1209. Joint.Parent = zam
  1210.  
  1211. local B = Instance.new("Part")
  1212. B.TopSurface = 0
  1213. B.BottomSurface = 0
  1214. B.Elasticity = 0
  1215. B.Friction = 1
  1216. B.formFactor = "Symmetric"
  1217. B.Size = Vector3.new(1, 1, 1)
  1218. B.Transparency = 1
  1219. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  1220. B.Parent = mode
  1221. local W = Instance.new("Weld")
  1222. W.Part0 = Limb
  1223. W.Part1 = B
  1224. W.C0 = CFrame.new(0, -0.5, 0)
  1225. W.Parent = Limb
  1226.  
  1227. end
  1228. if x[i].Name=="Right Leg" then
  1229. --x[i].Velocity = Vector3.new(0, 0, 0)
  1230. --x[i].RotVelocity = Vector3.new(0, 0, 0)
  1231. local Limb=x[i]:Clone()
  1232. Limb.Parent=mode
  1233. Limb.CFrame = zam.CFrame * CFrame.new(0.5, -2, 0)
  1234. Limb.Elasticity = 0
  1235. Limb.Friction = 1
  1236. local Joint = Instance.new("Rotate")
  1237. Joint.Name = "RightHip"
  1238. Joint.Part0 = zam
  1239. Joint.Part1 = Limb
  1240. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1241. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1242. Joint.Parent = zam
  1243.  
  1244. local B = Instance.new("Part")
  1245. B.TopSurface = 0
  1246. B.BottomSurface = 0
  1247. B.Elasticity = 0
  1248. B.Friction = 1
  1249. B.formFactor = "Symmetric"
  1250. B.Size = Vector3.new(1, 1, 1)
  1251. B.Transparency = 1
  1252. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  1253. B.Parent = mode
  1254. local W = Instance.new("Weld")
  1255. W.Part0 = Limb
  1256. W.Part1 = B
  1257. W.C0 = CFrame.new(0, -0.5, 0)
  1258. W.Parent = Limb
  1259.  
  1260. end
  1261. if x[i].Name=="Left Leg" then
  1262. --x[i].Velocity = Vector3.new(0, 0, 0)
  1263. --x[i].RotVelocity = Vector3.new(0, 0, 0)
  1264. local Limb=x[i]:Clone()
  1265. Limb.Parent=mode
  1266. Limb.CFrame = zam.CFrame * CFrame.new(-0.5, -2, 0)
  1267. Limb.Elasticity = 0
  1268. Limb.Friction = 1
  1269. local Joint = Instance.new("Rotate")
  1270. Joint.Name = "LeftHip"
  1271. Joint.Part0 = zam
  1272. Joint.Part1 = Limb
  1273. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1274. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1275. Joint.Parent = zam
  1276.  
  1277. local B = Instance.new("Part")
  1278. B.TopSurface = 0
  1279. B.BottomSurface = 0
  1280. B.Elasticity = 0
  1281. B.Friction = 1
  1282. B.formFactor = "Symmetric"
  1283. B.Size = Vector3.new(1, 1, 1)
  1284. B.Transparency = 1
  1285. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  1286. B.Parent = mode
  1287. local W = Instance.new("Weld")
  1288. W.Part0 = Limb
  1289. W.Part1 = B
  1290. W.C0 = CFrame.new(0, -0.5, 0)
  1291. W.Parent = Limb
  1292.  
  1293. end
  1294. end
  1295.  
  1296. local Bar = Instance.new("Part")
  1297. Bar.TopSurface = 0
  1298. Bar.BottomSurface = 0
  1299. Bar.Elasticity = 0
  1300. Bar.Friction = 1
  1301. Bar.formFactor = "Symmetric"
  1302. Bar.Size = Vector3.new(1, 1, 1)
  1303. Bar.Transparency = 1
  1304. Bar.CFrame = zam.CFrame * CFrame.new(0, 0.5, 0)
  1305. Bar.Parent = mode
  1306. local Weld = Instance.new("Weld")
  1307. Weld.Part0 = zam
  1308. Weld.Part1 = Bar
  1309. Weld.C0 = CFrame.new(0, 0.5, 0)
  1310. Weld.Parent = zam
  1311. end
  1312. wait()
  1313. Character:remove()
  1314. mode:FindFirstChild("Head").Velocity = Vector3.new(0,0,0)
  1315. mode:FindFirstChild("Left Arm").Velocity = Vector3.new(0,0,0)
  1316. mode:FindFirstChild("Left Leg").Velocity = Vector3.new(0,0,0)
  1317. mode:FindFirstChild("Right Arm").Velocity = Vector3.new(0,0,0)
  1318. mode:FindFirstChild("Right Leg").Velocity = Vector3.new(0,0,0)
  1319. mode:FindFirstChild("Torso").Velocity = Vector3.new(0,0,0)
  1320. x=mode:GetChildren()
  1321. for i=1,#x do
  1322. if (x[i].className=="Hat") then
  1323. if x[i]:findFirstChild("Handle") then
  1324. x[i].Handle.Anchored = false
  1325. end
  1326. end
  1327. if (x[i].className =="Part") then
  1328. x[i].Anchored = false
  1329. end
  1330. end
  1331. local b = Instance.new("BodyPosition")
  1332. b.maxForce = Vector3.new(0, 3000, 0)
  1333. b.position = mode:findFirstChild("Torso").Position - Vector3.new(0, 25, 0)
  1334. b.Parent = mode:findFirstChild("Torso")
  1335. wait(5)
  1336. for i=1,#x do
  1337. if (x[i].className=="Hat") then
  1338. if x[i]:findFirstChild("Handle") then
  1339. x[i].Handle.Anchored = true
  1340. end
  1341. end
  1342. if (x[i].className =="Part") then
  1343. x[i].Anchored = true
  1344. end
  1345. end
  1346. end
  1347.  
  1348. Humanoid.Died:connect(OnDeath)
  1349. end,o120)
  1350. end))
  1351. o121.Name = "Cleaner"
  1352. o121.Parent = o120
  1353. o121.Disabled = true
  1354. table.insert(cors,coroutine.create(function()
  1355. wait()
  1356. runDummyScript(function()
  1357. wait(30) -- removes the raggy in 10 seconds.
  1358. script.Parent:Destroy()
  1359. end,o121)
  1360. end))
  1361. o122.Name = "Read me"
  1362. o122.Parent = o2
  1363. table.insert(cors,coroutine.create(function()
  1364. wait()
  1365. runDummyScript(function()
  1366. --| Help for R15 model Zombie |--
  1367. --
  1368. -- To edit the zombie's damage go to LeftLowerArm/RightLowerArm > Damage Script > human.Health = human.Health - 5
  1369. -- Edit the number to whatever you'd like
  1370. -- The player will recieve damage from the LeftLowerArm and RightLowerArm
  1371. -- To edit the walkspeed go to Humanoid > Scroll to the bottom > Edit the number shown after WalkSpeed
  1372. -- You can also edit max health and spawn health under Humanoid > game
  1373. --
  1374. -- Have fun!
  1375. --
  1376. -- ImFarAway
  1377. end,o122)
  1378. end))
  1379. o123.Parent = o2
  1380. o123.Material = Enum.Material.Neon
  1381. o123.BrickColor = BrickColor.new("Really red")
  1382. o123.Position = Vector3.new(-5.77007198, 4.67999554, -11.1297207)
  1383. o123.CanCollide = false
  1384. o123.Shape = Enum.PartType.Ball
  1385. o123.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  1386. o123.CFrame = CFrame.new(-5.77007198, 4.67999554, -11.1297207, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1387. o123.BottomSurface = Enum.SurfaceType.Smooth
  1388. o123.TopSurface = Enum.SurfaceType.Smooth
  1389. o123.Color = Color3.new(1, 0, 0)
  1390. o123.Position = Vector3.new(-5.77007198, 4.67999554, -11.1297207)
  1391. o124.Parent = o2
  1392. o124.Material = Enum.Material.Neon
  1393. o124.BrickColor = BrickColor.new("Really red")
  1394. o124.Position = Vector3.new(-5.69007015, 4.67999554, -11.5097237)
  1395. o124.CanCollide = false
  1396. o124.Shape = Enum.PartType.Ball
  1397. o124.Size = Vector3.new(0.200000003, 0.200000003, 0.200000003)
  1398. o124.CFrame = CFrame.new(-5.69007015, 4.67999554, -11.5097237, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1399. o124.BottomSurface = Enum.SurfaceType.Smooth
  1400. o124.TopSurface = Enum.SurfaceType.Smooth
  1401. o124.Color = Color3.new(1, 0, 0)
  1402. o124.Position = Vector3.new(-5.69007015, 4.67999554, -11.5097237)
  1403. o125.Name = "Animate"
  1404. o125.Parent = o2
  1405. table.insert(cors,coroutine.create(function()
  1406. wait()
  1407. runDummyScript(function()
  1408. function waitForChild(parent, childName)
  1409. local child = parent:findFirstChild(childName)
  1410. if child then return child end
  1411. while true do
  1412. child = parent.ChildAdded:wait()
  1413. if child.Name==childName then return child end
  1414. end
  1415. end
  1416.  
  1417. local Figure = script.Parent
  1418. local Humanoid = waitForChild(Figure, "Humanoid")
  1419. local pose = "Standing"
  1420.  
  1421. local currentAnim = ""
  1422. local currentAnimInstance = nil
  1423. local currentAnimTrack = nil
  1424. local currentAnimKeyframeHandler = nil
  1425. local currentAnimSpeed = 0.5
  1426. local animTable = {}
  1427. local animNames = {
  1428. idle = {
  1429. { id = "http://www.roblox.com/asset/?id=865721441", weight = 1 },
  1430. { id = "http://www.roblox.com/asset/?id=865721441", weight = 9 }
  1431. },
  1432. walk = {
  1433. { id = "http://www.roblox.com/asset/?id=865719063", weight = 5 }
  1434. },
  1435. run = {
  1436. { id = "http://www.roblox.com/asset/?id=865719063", weight = 5 }
  1437. },
  1438. swim = {
  1439. { id = "http://www.roblox.com/asset/?id=507784897", weight = 10 }
  1440. },
  1441. swimidle = {
  1442. { id = "http://www.roblox.com/asset/?id=507785072", weight = 10 }
  1443. },
  1444. jump = {
  1445. { id = "http://www.roblox.com/asset/?id=507765000", weight = 10 }
  1446. },
  1447. fall = {
  1448. { id = "http://www.roblox.com/asset/?id=507767968", weight = 10 }
  1449. },
  1450. climb = {
  1451. { id = "http://www.roblox.com/asset/?id=507765644", weight = 10 }
  1452. },
  1453. sit = {
  1454. { id = "http://www.roblox.com/asset/?id=507768133", weight = 10 }
  1455. },
  1456. toolnone = {
  1457. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  1458. },
  1459. toolslash = {
  1460. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  1461. -- { id = "slash.xml", weight = 10 }
  1462. },
  1463. toollunge = {
  1464. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  1465. },
  1466. wave = {
  1467. { id = "http://www.roblox.com/asset/?id=507770239", weight = 10 }
  1468. },
  1469. point = {
  1470. { id = "http://www.roblox.com/asset/?id=507770453", weight = 10 }
  1471. },
  1472. dance = {
  1473. { id = "http://www.roblox.com/asset/?id=507771019", weight = 10 },
  1474. { id = "http://www.roblox.com/asset/?id=507771955", weight = 10 },
  1475. { id = "http://www.roblox.com/asset/?id=507772104", weight = 10 }
  1476. },
  1477. dance2 = {
  1478. { id = "http://www.roblox.com/asset/?id=507776043", weight = 10 },
  1479. { id = "http://www.roblox.com/asset/?id=507776720", weight = 10 },
  1480. { id = "http://www.roblox.com/asset/?id=507776879", weight = 10 }
  1481. },
  1482. dance3 = {
  1483. { id = "http://www.roblox.com/asset/?id=507777268", weight = 10 },
  1484. { id = "http://www.roblox.com/asset/?id=507777451", weight = 10 },
  1485. { id = "http://www.roblox.com/asset/?id=507777623", weight = 10 }
  1486. },
  1487. laugh = {
  1488. { id = "http://www.roblox.com/asset/?id=507770818", weight = 10 }
  1489. },
  1490. cheer = {
  1491. { id = "http://www.roblox.com/asset/?id=507770677", weight = 10 }
  1492. },
  1493. }
  1494.  
  1495. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  1496. local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  1497.  
  1498. math.randomseed(tick())
  1499.  
  1500. function configureAnimationSet(name, fileList)
  1501. if (animTable[name] ~= nil) then
  1502. for _, connection in pairs(animTable[name].connections) do
  1503. connection:disconnect()
  1504. end
  1505. end
  1506. animTable[name] = {}
  1507. animTable[name].count = 0
  1508. animTable[name].totalWeight = 0
  1509. animTable[name].connections = {}
  1510.  
  1511. -- check for config values
  1512. local config = script:FindFirstChild(name)
  1513. if (config ~= nil) then
  1514. -- print("Loading anims " .. name)
  1515. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  1516. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  1517. local idx = 1
  1518. for _, childPart in pairs(config:GetChildren()) do
  1519. if (childPart:IsA("Animation")) then
  1520. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  1521. animTable[name][idx] = {}
  1522. animTable[name][idx].anim = childPart
  1523. local weightObject = childPart:FindFirstChild("Weight")
  1524. if (weightObject == nil) then
  1525. animTable[name][idx].weight = 1
  1526. else
  1527. animTable[name][idx].weight = weightObject.Value
  1528. end
  1529. animTable[name].count = animTable[name].count + 1
  1530. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  1531. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  1532. idx = idx + 1
  1533. end
  1534. end
  1535. end
  1536.  
  1537. -- fallback to defaults
  1538. if (animTable[name].count <= 0) then
  1539. for idx, anim in pairs(fileList) do
  1540. animTable[name][idx] = {}
  1541. animTable[name][idx].anim = Instance.new("Animation")
  1542. animTable[name][idx].anim.Name = name
  1543. animTable[name][idx].anim.AnimationId = anim.id
  1544. animTable[name][idx].weight = anim.weight
  1545. animTable[name].count = animTable[name].count + 1
  1546. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  1547. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  1548. end
  1549. end
  1550. end
  1551.  
  1552. -- Setup animation objects
  1553. function scriptChildModified(child)
  1554. local fileList = animNames[child.Name]
  1555. if (fileList ~= nil) then
  1556. configureAnimationSet(child.Name, fileList)
  1557. end
  1558. end
  1559.  
  1560. script.ChildAdded:connect(scriptChildModified)
  1561. script.ChildRemoved:connect(scriptChildModified)
  1562.  
  1563.  
  1564. for name, fileList in pairs(animNames) do
  1565. configureAnimationSet(name, fileList)
  1566. end
  1567.  
  1568. -- ANIMATION
  1569.  
  1570. -- declarations
  1571. local toolAnim = "None"
  1572. local toolAnimTime = 0
  1573.  
  1574. local jumpAnimTime = 0
  1575. local jumpAnimDuration = 0.31
  1576.  
  1577. local toolTransitionTime = 0.1
  1578. local fallTransitionTime = 0.2
  1579.  
  1580. -- functions
  1581.  
  1582. function stopAllAnimations()
  1583. local oldAnim = currentAnim
  1584.  
  1585. -- return to idle if finishing an emote
  1586. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  1587. oldAnim = "idle"
  1588. end
  1589.  
  1590. currentAnim = ""
  1591. currentAnimInstance = nil
  1592. if (currentAnimKeyframeHandler ~= nil) then
  1593. currentAnimKeyframeHandler:disconnect()
  1594. end
  1595.  
  1596. if (currentAnimTrack ~= nil) then
  1597. currentAnimTrack:Stop()
  1598. currentAnimTrack:Destroy()
  1599. currentAnimTrack = nil
  1600. end
  1601. return oldAnim
  1602. end
  1603.  
  1604. function setAnimationSpeed(speed)
  1605. if speed ~= currentAnimSpeed then
  1606. currentAnimSpeed = speed
  1607. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  1608. end
  1609. end
  1610.  
  1611. function keyFrameReachedFunc(frameName)
  1612. if (frameName == "End") then
  1613. -- print("Keyframe : ".. frameName)
  1614.  
  1615. local repeatAnim = currentAnim
  1616. -- return to idle if finishing an emote
  1617. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  1618. repeatAnim = "idle"
  1619. end
  1620.  
  1621. local animSpeed = currentAnimSpeed
  1622. playAnimation(repeatAnim, 0.15, Humanoid)
  1623. setAnimationSpeed(animSpeed)
  1624. end
  1625. end
  1626.  
  1627. -- Preload animations
  1628. function playAnimation(animName, transitionTime, humanoid)
  1629.  
  1630. local roll = math.random(1, animTable[animName].totalWeight)
  1631. local origRoll = roll
  1632. local idx = 1
  1633. while (roll > animTable[animName][idx].weight) do
  1634. roll = roll - animTable[animName][idx].weight
  1635. idx = idx + 1
  1636. end
  1637.  
  1638. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  1639.  
  1640. local anim = animTable[animName][idx].anim
  1641.  
  1642. -- switch animation
  1643. if (anim ~= currentAnimInstance) then
  1644.  
  1645. if (currentAnimTrack ~= nil) then
  1646. currentAnimTrack:Stop(transitionTime)
  1647. currentAnimTrack:Destroy()
  1648. end
  1649.  
  1650. currentAnimSpeed = 1.0
  1651.  
  1652. -- load it to the humanoid; get AnimationTrack
  1653. currentAnimTrack = humanoid:LoadAnimation(anim)
  1654.  
  1655. -- play the animation
  1656. currentAnimTrack:Play(transitionTime)
  1657. currentAnim = animName
  1658. currentAnimInstance = anim
  1659.  
  1660. -- set up keyframe name triggers
  1661. if (currentAnimKeyframeHandler ~= nil) then
  1662. currentAnimKeyframeHandler:disconnect()
  1663. end
  1664. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  1665.  
  1666. end
  1667.  
  1668. end
  1669.  
  1670. -------------------------------------------------------------------------------------------
  1671. -------------------------------------------------------------------------------------------
  1672.  
  1673. local toolAnimName = ""
  1674. local toolAnimTrack = nil
  1675. local toolAnimInstance = nil
  1676. local currentToolAnimKeyframeHandler = nil
  1677.  
  1678. function toolKeyFrameReachedFunc(frameName)
  1679. if (frameName == "End") then
  1680. -- print("Keyframe : ".. frameName)
  1681. playToolAnimation(toolAnimName, 0.0, Humanoid)
  1682. end
  1683. end
  1684.  
  1685.  
  1686. function playToolAnimation(animName, transitionTime, humanoid)
  1687.  
  1688. local roll = math.random(1, animTable[animName].totalWeight)
  1689. local origRoll = roll
  1690. local idx = 1
  1691. while (roll > animTable[animName][idx].weight) do
  1692. roll = roll - animTable[animName][idx].weight
  1693. idx = idx + 1
  1694. end
  1695. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  1696. local anim = animTable[animName][idx].anim
  1697.  
  1698. if (toolAnimInstance ~= anim) then
  1699.  
  1700. if (toolAnimTrack ~= nil) then
  1701. toolAnimTrack:Stop()
  1702. toolAnimTrack:Destroy()
  1703. transitionTime = 0
  1704. end
  1705.  
  1706. -- load it to the humanoid; get AnimationTrack
  1707. toolAnimTrack = humanoid:LoadAnimation(anim)
  1708.  
  1709. -- play the animation
  1710. toolAnimTrack:Play(transitionTime)
  1711. toolAnimName = animName
  1712. toolAnimInstance = anim
  1713.  
  1714. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  1715. end
  1716. end
  1717.  
  1718. function stopToolAnimations()
  1719. local oldAnim = toolAnimName
  1720.  
  1721. if (currentToolAnimKeyframeHandler ~= nil) then
  1722. currentToolAnimKeyframeHandler:disconnect()
  1723. end
  1724.  
  1725. toolAnimName = ""
  1726. toolAnimInstance = nil
  1727. if (toolAnimTrack ~= nil) then
  1728. toolAnimTrack:Stop()
  1729. toolAnimTrack:Destroy()
  1730. toolAnimTrack = nil
  1731. end
  1732.  
  1733.  
  1734. return oldAnim
  1735. end
  1736.  
  1737. -------------------------------------------------------------------------------------------
  1738. -------------------------------------------------------------------------------------------
  1739.  
  1740.  
  1741. function onRunning(speed)
  1742. if speed > 0.01 then
  1743. local scale = 15.0
  1744. playAnimation("walk", 0.1, Humanoid)
  1745. setAnimationSpeed(speed / scale)
  1746. pose = "Running"
  1747. else
  1748. playAnimation("idle", 0.1, Humanoid)
  1749. pose = "Standing"
  1750. end
  1751. end
  1752.  
  1753. function onDied()
  1754. pose = "Dead"
  1755. end
  1756.  
  1757. function onJumping()
  1758. playAnimation("jump", 0.1, Humanoid)
  1759. jumpAnimTime = jumpAnimDuration
  1760. pose = "Jumping"
  1761. end
  1762.  
  1763. function onClimbing(speed)
  1764. local scale = 5.0
  1765. playAnimation("climb", 0.1, Humanoid)
  1766. setAnimationSpeed(speed / scale)
  1767. pose = "Climbing"
  1768. end
  1769.  
  1770. function onGettingUp()
  1771. pose = "GettingUp"
  1772. end
  1773.  
  1774. function onFreeFall()
  1775. if (jumpAnimTime <= 0) then
  1776. playAnimation("fall", fallTransitionTime, Humanoid)
  1777. end
  1778. pose = "FreeFall"
  1779. end
  1780.  
  1781. function onFallingDown()
  1782. pose = "FallingDown"
  1783. end
  1784.  
  1785. function onSeated()
  1786. pose = "Seated"
  1787. end
  1788.  
  1789. function onPlatformStanding()
  1790. pose = "PlatformStanding"
  1791. end
  1792.  
  1793. function onSwimming(speed)
  1794. if speed > 1.00 then
  1795. local scale = 10.0
  1796. playAnimation("swim", 0.4, Humanoid)
  1797. setAnimationSpeed(speed / scale)
  1798. pose = "Swimming"
  1799. else
  1800. playAnimation("swimidle", 0.4, Humanoid)
  1801. pose = "Standing"
  1802. end
  1803. end
  1804.  
  1805. function getTool()
  1806. for _, kid in ipairs(Figure:GetChildren()) do
  1807. if kid.className == "Tool" then return kid end
  1808. end
  1809. return nil
  1810. end
  1811.  
  1812. function getToolAnim(tool)
  1813. for _, c in ipairs(tool:GetChildren()) do
  1814. if c.Name == "toolanim" and c.className == "StringValue" then
  1815. return c
  1816. end
  1817. end
  1818. return nil
  1819. end
  1820.  
  1821. function animateTool()
  1822.  
  1823. if (toolAnim == "None") then
  1824. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  1825. return
  1826. end
  1827.  
  1828. if (toolAnim == "Slash") then
  1829. playToolAnimation("toolslash", 0, Humanoid)
  1830. return
  1831. end
  1832.  
  1833. if (toolAnim == "Lunge") then
  1834. playToolAnimation("toollunge", 0, Humanoid)
  1835. return
  1836. end
  1837. end
  1838.  
  1839. function moveSit()
  1840. RightShoulder.MaxVelocity = 0.15
  1841. LeftShoulder.MaxVelocity = 0.15
  1842. RightShoulder:SetDesiredAngle(3.14 /2)
  1843. LeftShoulder:SetDesiredAngle(-3.14 /2)
  1844. RightHip:SetDesiredAngle(3.14 /2)
  1845. LeftHip:SetDesiredAngle(-3.14 /2)
  1846. end
  1847.  
  1848. local lastTick = 0
  1849.  
  1850. function move(time)
  1851. local amplitude = 1
  1852. local frequency = 1
  1853. local deltaTime = time - lastTick
  1854. lastTick = time
  1855.  
  1856. local climbFudge = 0
  1857. local setAngles = false
  1858.  
  1859. if (jumpAnimTime > 0) then
  1860. jumpAnimTime = jumpAnimTime - deltaTime
  1861. end
  1862.  
  1863. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1864. playAnimation("fall", fallTransitionTime, Humanoid)
  1865. elseif (pose == "Seated") then
  1866. playAnimation("sit", 0.5, Humanoid)
  1867. return
  1868. elseif (pose == "Running") then
  1869. playAnimation("walk", 0.1, Humanoid)
  1870. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1871. stopAllAnimations()
  1872. amplitude = 0.1
  1873. frequency = 1
  1874. setAngles = true
  1875. end
  1876.  
  1877. -- Tool Animation handling
  1878. local tool = getTool()
  1879. if tool then
  1880.  
  1881. animStringValueObject = getToolAnim(tool)
  1882.  
  1883. if animStringValueObject then
  1884. toolAnim = animStringValueObject.Value
  1885. -- message recieved, delete StringValue
  1886. animStringValueObject.Parent = nil
  1887. toolAnimTime = time + .3
  1888. end
  1889.  
  1890. if time > toolAnimTime then
  1891. toolAnimTime = 0
  1892. toolAnim = "None"
  1893. end
  1894.  
  1895. animateTool()
  1896. else
  1897. stopToolAnimations()
  1898. toolAnim = "None"
  1899. toolAnimInstance = nil
  1900. toolAnimTime = 0
  1901. end
  1902. end
  1903.  
  1904. -- connect events
  1905. Humanoid.Died:connect(onDied)
  1906. Humanoid.Running:connect(onRunning)
  1907. Humanoid.Jumping:connect(onJumping)
  1908. Humanoid.Climbing:connect(onClimbing)
  1909. Humanoid.GettingUp:connect(onGettingUp)
  1910. Humanoid.FreeFalling:connect(onFreeFall)
  1911. Humanoid.FallingDown:connect(onFallingDown)
  1912. Humanoid.Seated:connect(onSeated)
  1913. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1914. Humanoid.Swimming:connect(onSwimming)
  1915.  
  1916. -- setup emote chat hook
  1917. script.msg.Changed:connect(function(msg)
  1918. script.msg.Value = ""
  1919. local emote = ""
  1920. if (string.sub(msg, 1, 3) == "/e ") then
  1921. emote = string.sub(msg, 4)
  1922. elseif (string.sub(msg, 1, 7) == "/emote ") then
  1923. emote = string.sub(msg, 8)
  1924. end
  1925.  
  1926. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  1927. playAnimation(emote, 0.1, Humanoid)
  1928. end
  1929. -- print("===> " .. string.sub(msg, 1, 3) .. "(" .. emote .. ")")
  1930. end)
  1931.  
  1932.  
  1933. -- main program
  1934.  
  1935. local runService = game:service("RunService");
  1936.  
  1937. -- print("bottom")
  1938.  
  1939. -- initialize to idle
  1940. playAnimation("idle", 0.1, Humanoid)
  1941. pose = "Standing"
  1942.  
  1943. while Figure.Parent~=nil do
  1944. local _, time = wait(0.1)
  1945. move(time)
  1946. end
  1947.  
  1948.  
  1949.  
  1950. end,o125)
  1951. end))
  1952. o126.Name = "msg"
  1953. o126.Parent = o125
  1954. o127.Name = "climb"
  1955. o127.Parent = o125
  1956. o128.Name = "ClimbAnim"
  1957. o128.Parent = o127
  1958. o128.AnimationId = "http://www.roblox.com/asset/?id=507765644"
  1959. o129.Name = "idle"
  1960. o129.Parent = o125
  1961. o130.Name = "sit"
  1962. o130.Parent = o125
  1963. o131.Name = "SitAnim"
  1964. o131.Parent = o130
  1965. o131.AnimationId = "http://www.roblox.com/asset/?id=507768133"
  1966. o132.Name = "swim"
  1967. o132.Parent = o125
  1968. o133.Name = "Swim"
  1969. o133.Parent = o132
  1970. o133.AnimationId = "http://www.roblox.com/asset/?id=507784897"
  1971. o134.Name = "swimidle"
  1972. o134.Parent = o125
  1973. o135.Name = "SwimIdle"
  1974. o135.Parent = o134
  1975. o135.AnimationId = "http://www.roblox.com/asset/?id=481825862"
  1976. o136.Name = "toolnone"
  1977. o136.Parent = o125
  1978. o137.Name = "ToolNoneAnim"
  1979. o137.Parent = o136
  1980. o137.AnimationId = "http://www.roblox.com/asset/?id=507768375"
  1981. o138.Name = "walk"
  1982. o138.Parent = o125
  1983. o139.Name = "fall"
  1984. o139.Parent = o125
  1985. o140.Name = "FallAnim"
  1986. o140.Parent = o139
  1987. o140.AnimationId = "http://www.roblox.com/asset/?id=616157476"
  1988. o141.Name = "jump"
  1989. o141.Parent = o125
  1990. o142.Name = "JumpAnim"
  1991. o142.Parent = o141
  1992. o142.AnimationId = "http://www.roblox.com/asset/?id=616161997"
  1993. o143.Name = "Read Me"
  1994. o143.Parent = o2
  1995. table.insert(cors,coroutine.create(function()
  1996. wait()
  1997. runDummyScript(function()
  1998. --(This Enemy can pass through soild object and will pass through the ground you can change it if you want, also it
  1999. --kill any thing that it touch)it only dose 50 damage but it still kills like that you can change the damage
  2000. --by going to the left ans right hands
  2001. --
  2002.  
  2003.  
  2004. end,o143)
  2005. end))
  2006. mas.Parent = workspace
  2007. mas:MakeJoints()
  2008. local mas1 = mas:GetChildren()
  2009. for i=1,#mas1 do
  2010. mas1[i].Parent = workspace
  2011. ypcall(function() mas1[i]:MakeJoints() end)
  2012. end
  2013. mas:Destroy()
  2014. for i=1,#cors do
  2015. coroutine.resume(cors[i])
  2016. end
  2017.  
  2018. game:GetService("Lighting").Ambient = Color3.new(0, 0, 0)
  2019. game:GetService("Lighting").Brightness = 1
  2020. game:GetService("Lighting").ColorShift_Bottom = Color3.new(0, 0, 0)
  2021. game:GetService("Lighting").ColorShift_Top = Color3.new(0, 0, 0)
  2022. game:GetService("Lighting").GlobalShadows = true
  2023. game:GetService("Lighting").OutdoorAmbient = Color3.new(0.5, 0.5, 0.5)
  2024. game:GetService("Lighting").Outlines = false
  2025. game:GetService("Lighting").GeographicLatitude = 41.733299255371
  2026. game:GetService("Lighting").TimeOfDay = "14:00:00"
  2027. game:GetService("Lighting").FogColor = Color3.new(0.75, 0.75, 0.75)
  2028. game:GetService("Lighting").FogEnd = 100000
  2029. game:GetService("Lighting").FogStart = 0
Add Comment
Please, Sign In to add comment