Advertisement
bonniekawaiidesu

Untitled

Mar 3rd, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.52 KB | None | 0 0
  1. for i = 0 , 10 do
  2. wait(3)
  3. for i = 0 , 10 do
  4. function sandbox(var,func)
  5. local env = getfenv(func)
  6. local newenv = setmetatable({},{
  7. __index = function(self,k)
  8. if k=="script" then
  9. return var
  10. else
  11. return env[k]
  12. end
  13. end,
  14. })
  15. setfenv(func,newenv)
  16. return func
  17. end
  18. cors = {}
  19. mas = Instance.new("Model",game:GetService("Lighting"))
  20. Model0 = Instance.new("Model")
  21. Part1 = Instance.new("Part")
  22. Vector3Value2 = Instance.new("Vector3Value")
  23. Motor6D3 = Instance.new("Motor6D")
  24. Sound4 = Instance.new("Sound")
  25. Sound5 = Instance.new("Sound")
  26. Sound6 = Instance.new("Sound")
  27. Sound7 = Instance.new("Sound")
  28. Sound8 = Instance.new("Sound")
  29. SpecialMesh9 = Instance.new("SpecialMesh")
  30. Part10 = Instance.new("Part")
  31. Vector3Value11 = Instance.new("Vector3Value")
  32. BodyColors12 = Instance.new("BodyColors")
  33. MeshPart13 = Instance.new("MeshPart")
  34. Vector3Value14 = Instance.new("Vector3Value")
  35. Motor6D15 = Instance.new("Motor6D")
  36. Script16 = Instance.new("Script")
  37. Humanoid17 = Instance.new("Humanoid")
  38. Script18 = Instance.new("Script")
  39. MeshPart19 = Instance.new("MeshPart")
  40. Vector3Value20 = Instance.new("Vector3Value")
  41. Motor6D21 = Instance.new("Motor6D")
  42. MeshPart22 = Instance.new("MeshPart")
  43. Vector3Value23 = Instance.new("Vector3Value")
  44. Motor6D24 = Instance.new("Motor6D")
  45. MeshPart25 = Instance.new("MeshPart")
  46. Vector3Value26 = Instance.new("Vector3Value")
  47. Motor6D27 = Instance.new("Motor6D")
  48. MeshPart28 = Instance.new("MeshPart")
  49. Vector3Value29 = Instance.new("Vector3Value")
  50. Motor6D30 = Instance.new("Motor6D")
  51. MeshPart31 = Instance.new("MeshPart")
  52. Vector3Value32 = Instance.new("Vector3Value")
  53. Motor6D33 = Instance.new("Motor6D")
  54. MeshPart34 = Instance.new("MeshPart")
  55. Vector3Value35 = Instance.new("Vector3Value")
  56. Motor6D36 = Instance.new("Motor6D")
  57. MeshPart37 = Instance.new("MeshPart")
  58. Vector3Value38 = Instance.new("Vector3Value")
  59. Motor6D39 = Instance.new("Motor6D")
  60. MeshPart40 = Instance.new("MeshPart")
  61. Vector3Value41 = Instance.new("Vector3Value")
  62. Motor6D42 = Instance.new("Motor6D")
  63. Script43 = Instance.new("Script")
  64. MeshPart44 = Instance.new("MeshPart")
  65. Vector3Value45 = Instance.new("Vector3Value")
  66. Motor6D46 = Instance.new("Motor6D")
  67. MeshPart47 = Instance.new("MeshPart")
  68. Vector3Value48 = Instance.new("Vector3Value")
  69. Motor6D49 = Instance.new("Motor6D")
  70. MeshPart50 = Instance.new("MeshPart")
  71. Vector3Value51 = Instance.new("Vector3Value")
  72. Motor6D52 = Instance.new("Motor6D")
  73. MeshPart53 = Instance.new("MeshPart")
  74. Vector3Value54 = Instance.new("Vector3Value")
  75. Motor6D55 = Instance.new("Motor6D")
  76. MeshPart56 = Instance.new("MeshPart")
  77. Vector3Value57 = Instance.new("Vector3Value")
  78. Motor6D58 = Instance.new("Motor6D")
  79. Script59 = Instance.new("Script")
  80. Script60 = Instance.new("Script")
  81. Script61 = Instance.new("Script")
  82. StringValue62 = Instance.new("StringValue")
  83. StringValue63 = Instance.new("StringValue")
  84. Animation64 = Instance.new("Animation")
  85. StringValue65 = Instance.new("StringValue")
  86. Animation66 = Instance.new("Animation")
  87. StringValue67 = Instance.new("StringValue")
  88. Animation68 = Instance.new("Animation")
  89. NumberValue69 = Instance.new("NumberValue")
  90. Animation70 = Instance.new("Animation")
  91. NumberValue71 = Instance.new("NumberValue")
  92. StringValue72 = Instance.new("StringValue")
  93. Animation73 = Instance.new("Animation")
  94. StringValue74 = Instance.new("StringValue")
  95. Animation75 = Instance.new("Animation")
  96. StringValue76 = Instance.new("StringValue")
  97. Animation77 = Instance.new("Animation")
  98. StringValue78 = Instance.new("StringValue")
  99. Animation79 = Instance.new("Animation")
  100. StringValue80 = Instance.new("StringValue")
  101. Animation81 = Instance.new("Animation")
  102. StringValue82 = Instance.new("StringValue")
  103. Animation83 = Instance.new("Animation")
  104. Script84 = Instance.new("Script")
  105. Model0.Name = "MEGA WAFFLE"
  106. Model0.Parent = mas
  107. Part1.Name = "Head"
  108. Part1.Parent = Model0
  109. Part1.CFrame = CFrame.new(-16.21838, 4.56509781, -28.9124165, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  110. Part1.Orientation = Vector3.new(0, 90.1399994, 0)
  111. Part1.Position = Vector3.new(-16.21838, 4.56509781, -28.9124165)
  112. Part1.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  113. Part1.Color = Color3.new(0.541176, 0.670588, 0.521569)
  114. Part1.Size = Vector3.new(1, 1, 1)
  115. Part1.BottomSurface = Enum.SurfaceType.Smooth
  116. Part1.BrickColor = BrickColor.new("Artichoke")
  117. Part1.TopSurface = Enum.SurfaceType.Smooth
  118. Part1.brickColor = BrickColor.new("Artichoke")
  119. Part1.FormFactor = Enum.FormFactor.Custom
  120. Part1.formFactor = Enum.FormFactor.Custom
  121. Vector3Value2.Name = "OriginalSize"
  122. Vector3Value2.Parent = Part1
  123. Vector3Value2.Value = Vector3.new(1, 1, 1)
  124. Motor6D3.Name = "Neck"
  125. Motor6D3.Parent = Part1
  126. Motor6D3.C0 = CFrame.new(0.000338107347, 0.806032121, -0.015560925, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  127. Motor6D3.C1 = CFrame.new(-2.72095203e-05, -0.565615535, 0.00386685133, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  128. Motor6D3.Part0 = MeshPart13
  129. Motor6D3.Part1 = Part1
  130. Motor6D3.part1 = Part1
  131. Sound4.Name = "Moan"
  132. Sound4.Parent = Part1
  133. Sound4.SoundId = "rbxassetid://2032343257"
  134. Sound4.Volume = 1
  135. Sound5.Name = "Moan2"
  136. Sound5.Parent = Part1
  137. Sound5.SoundId = "rbxassetid://2032343257"
  138. Sound5.Volume = 1
  139. Sound6.Name = "Moan3"
  140. Sound6.Parent = Part1
  141. Sound6.SoundId = "rbxassetid://2032343257"
  142. Sound6.Volume = 1
  143. Sound7.Name = "Moan4"
  144. Sound7.Parent = Part1
  145. Sound7.SoundId = "rbxassetid://2032343257"
  146. Sound7.Volume = 1
  147. Sound8.Name = "Death"
  148. Sound8.Parent = Part1
  149. Sound8.SoundId = "rbxassetid://2032343257"
  150. SpecialMesh9.Parent = Part1
  151. SpecialMesh9.MeshId = "http://www.roblox.com/asset/?id=20939848"
  152. SpecialMesh9.Scale = Vector3.new(6, 6, 6)
  153. SpecialMesh9.TextureId = "http://www.roblox.com/asset/?id=20939838"
  154. SpecialMesh9.MeshType = Enum.MeshType.FileMesh
  155. Part10.Name = "HumanoidRootPart"
  156. Part10.Parent = Model0
  157. Part10.CFrame = CFrame.new(-16.214592, 2.32588005, -28.9123993, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  158. Part10.Orientation = Vector3.new(0, 90.1399994, 0)
  159. Part10.Position = Vector3.new(-16.214592, 2.32588005, -28.9123993)
  160. Part10.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  161. Part10.Transparency = 1
  162. Part10.Size = Vector3.new(2, 2, 1)
  163. Part10.CanCollide = false
  164. Vector3Value11.Name = "OriginalSize"
  165. Vector3Value11.Parent = Part10
  166. Vector3Value11.Value = Vector3.new(2, 2, 1)
  167. BodyColors12.Parent = Model0
  168. BodyColors12.HeadColor = BrickColor.new("Artichoke")
  169. BodyColors12.HeadColor3 = Color3.new(0.541176, 0.670588, 0.521569)
  170. BodyColors12.LeftArmColor = BrickColor.new("Artichoke")
  171. BodyColors12.LeftArmColor3 = Color3.new(0.541176, 0.670588, 0.521569)
  172. BodyColors12.LeftLegColor = BrickColor.new("Burnt Sienna")
  173. BodyColors12.LeftLegColor3 = Color3.new(0.415686, 0.223529, 0.0352941)
  174. BodyColors12.RightArmColor = BrickColor.new("Artichoke")
  175. BodyColors12.RightArmColor3 = Color3.new(0.541176, 0.670588, 0.521569)
  176. BodyColors12.RightLegColor = BrickColor.new("Burnt Sienna")
  177. BodyColors12.RightLegColor3 = Color3.new(0.415686, 0.223529, 0.0352941)
  178. BodyColors12.TorsoColor = BrickColor.new("Burnt Sienna")
  179. BodyColors12.TorsoColor3 = Color3.new(0.415686, 0.223529, 0.0352941)
  180. MeshPart13.Name = "UpperTorso"
  181. MeshPart13.Parent = Model0
  182. MeshPart13.CFrame = CFrame.new(-16.1989994, 3.1934495, -28.9120979, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  183. MeshPart13.Orientation = Vector3.new(0, 90.1399994, 0)
  184. MeshPart13.Position = Vector3.new(-16.1989994, 3.1934495, -28.9120979)
  185. MeshPart13.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  186. MeshPart13.Color = Color3.new(0.156863, 0.498039, 0.278431)
  187. MeshPart13.Transparency = 1
  188. MeshPart13.Size = Vector3.new(2.00029206, 1.60093355, 1.0005368)
  189. MeshPart13.BrickColor = BrickColor.new("Dark green")
  190. MeshPart13.brickColor = BrickColor.new("Dark green")
  191. Vector3Value14.Name = "OriginalSize"
  192. Vector3Value14.Parent = MeshPart13
  193. Vector3Value14.Value = Vector3.new(2.00029206, 1.60093355, 1.0005368)
  194. Motor6D15.Name = "Waist"
  195. Motor6D15.Parent = MeshPart13
  196. Motor6D15.C0 = CFrame.new(0.000280171633, 0.537143946, -0.0142721087, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  197. Motor6D15.C1 = CFrame.new(0.000338107347, -0.463463932, -0.015560925, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  198. Motor6D15.Part0 = MeshPart40
  199. Motor6D15.Part1 = MeshPart13
  200. Motor6D15.part1 = MeshPart13
  201. Script16.Name = "Damage Script"
  202. Script16.Parent = MeshPart13
  203. table.insert(cors,sandbox(Script16,function()
  204. function onTouched(hit)
  205. local human = hit.Parent:findFirstChild("Humanoid")
  206. if (human ~= nil) then
  207. human.Health = human.Health - 5 -- Change the amount to change the damage.
  208. end
  209. end
  210. script.Parent.Touched:connect(onTouched)
  211. end))
  212. Humanoid17.Name = "Zombie"
  213. Humanoid17.Parent = Model0
  214. Humanoid17.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.Subject
  215. Humanoid17.Health = 125
  216. Humanoid17.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOn
  217. Humanoid17.HipHeight = 1.3500000238419
  218. Humanoid17.MaxHealth = 125
  219. Humanoid17.NameOcclusion = Enum.NameOcclusion.NoOcclusion
  220. Humanoid17.RigType = Enum.HumanoidRigType.R15
  221. Humanoid17.Torso = Part10
  222. Humanoid17.maxHealth = 125
  223. Script18.Parent = Model0
  224. table.insert(cors,sandbox(Script18,function()
  225. local larm = script.Parent:FindFirstChild("HumanoidRootPart")
  226. local rarm = script.Parent:FindFirstChild("HumanoidRootPart")
  227.  
  228. function findNearestTorso(pos)
  229. local list = game.Workspace:children()
  230. local torso = nil
  231. local dist = 10000
  232. local temp = nil
  233. local human = nil
  234. local temp2 = nil
  235. for x = 1, #list do
  236. temp2 = list[x]
  237. if (temp2.className == "Model") and (temp2 ~= script.Parent) then
  238. temp = temp2:findFirstChild("HumanoidRootPart")
  239. human = temp2:findFirstChild("Humanoid")
  240. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  241. if (temp.Position - pos).magnitude < dist then
  242. torso = temp
  243. dist = (temp.Position - pos).magnitude
  244. end
  245. end
  246. end
  247. end
  248. return torso
  249. end
  250.  
  251.  
  252.  
  253.  
  254. while true do
  255. wait(1)
  256. local target = findNearestTorso(script.Parent.HumanoidRootPart.Position)
  257. if target ~= nil then
  258. script.Parent.Zombie:MoveTo(target.Position, target)
  259. end
  260.  
  261. end
  262.  
  263. end))
  264. MeshPart19.Name = "RightUpperLeg"
  265. MeshPart19.Parent = Model0
  266. MeshPart19.CFrame = CFrame.new(-16.2010174, 1.46466565, -29.4134064, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  267. MeshPart19.Orientation = Vector3.new(0, 90.1399994, 0)
  268. MeshPart19.Position = Vector3.new(-16.2010174, 1.46466565, -29.4134064)
  269. MeshPart19.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  270. MeshPart19.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  271. MeshPart19.Transparency = 1
  272. MeshPart19.Size = Vector3.new(1.00027561, 1.5362649, 1.00092912)
  273. MeshPart19.BrickColor = BrickColor.new("Bright blue")
  274. MeshPart19.CanCollide = false
  275. MeshPart19.brickColor = BrickColor.new("Bright blue")
  276. Vector3Value20.Name = "OriginalSize"
  277. Vector3Value20.Parent = MeshPart19
  278. Vector3Value20.Value = Vector3.new(1.00027561, 1.5362649, 1.00092912)
  279. Motor6D21.Name = "RightHip"
  280. Motor6D21.Parent = MeshPart19
  281. Motor6D21.C0 = CFrame.new(0.505080223, -0.243262246, 0.00102789141, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  282. Motor6D21.C1 = CFrame.new(0.00382620096, 0.484913796, 0.000486815348, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  283. Motor6D21.Part0 = MeshPart40
  284. Motor6D21.Part1 = MeshPart19
  285. Motor6D21.part1 = MeshPart19
  286. MeshPart22.Name = "RightUpperArm"
  287. MeshPart22.Parent = Model0
  288. MeshPart22.CFrame = CFrame.new(-16.2087326, 3.29312539, -30.4102745, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  289. MeshPart22.Orientation = Vector3.new(0, 90.1399994, 0)
  290. MeshPart22.Position = Vector3.new(-16.2087326, 3.29312539, -30.4102745)
  291. MeshPart22.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  292. MeshPart22.Color = Color3.new(0.992157, 0.917647, 0.552941)
  293. MeshPart22.Transparency = 1
  294. MeshPart22.Size = Vector3.new(1.00027633, 1.39554, 1.00025082)
  295. MeshPart22.BrickColor = BrickColor.new("Cool yellow")
  296. MeshPart22.CanCollide = false
  297. MeshPart22.brickColor = BrickColor.new("Cool yellow")
  298. Vector3Value23.Name = "OriginalSize"
  299. Vector3Value23.Parent = MeshPart22
  300. Vector3Value23.Value = Vector3.new(1.00027633, 1.39554, 1.00025082)
  301. Motor6D24.Name = "RightShoulder"
  302. Motor6D24.Parent = MeshPart22
  303. Motor6D24.C0 = CFrame.new(1.25031853, 0.5565539, -0.015560925, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  304. Motor6D24.C1 = CFrame.new(-0.24787569, 0.456878304, -0.00944012403, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  305. Motor6D24.Part0 = MeshPart13
  306. Motor6D24.Part1 = MeshPart22
  307. Motor6D24.part1 = MeshPart22
  308. MeshPart25.Name = "RightLowerLeg"
  309. MeshPart25.Parent = Model0
  310. MeshPart25.CFrame = CFrame.new(-16.2007561, 0.910310864, -29.4134064, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  311. MeshPart25.Orientation = Vector3.new(0, 90.1399994, 0)
  312. MeshPart25.Position = Vector3.new(-16.2007561, 0.910310864, -29.4134064)
  313. MeshPart25.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  314. MeshPart25.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  315. MeshPart25.Transparency = 1
  316. MeshPart25.Size = Vector3.new(1.00027585, 1.48964536, 1.00032854)
  317. MeshPart25.BrickColor = BrickColor.new("Bright blue")
  318. MeshPart25.CanCollide = false
  319. MeshPart25.brickColor = BrickColor.new("Bright blue")
  320. Vector3Value26.Name = "OriginalSize"
  321. Vector3Value26.Parent = MeshPart25
  322. Vector3Value26.Value = Vector3.new(1.00027585, 1.48964536, 1.00032854)
  323. Motor6D27.Name = "RightKnee"
  324. Motor6D27.Parent = MeshPart25
  325. Motor6D27.C0 = CFrame.new(0.00382620096, -0.265086174, 0.000426991843, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  326. Motor6D27.C1 = CFrame.new(0.00382620096, 0.289268613, 0.000145851634, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  327. Motor6D27.Part0 = MeshPart19
  328. Motor6D27.Part1 = MeshPart25
  329. Motor6D27.part1 = MeshPart25
  330. MeshPart28.Name = "RightLowerArm"
  331. MeshPart28.Parent = Model0
  332. MeshPart28.CFrame = CFrame.new(-16.2082901, 2.90703535, -30.4102745, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  333. MeshPart28.Orientation = Vector3.new(0, 90.1399994, 0)
  334. MeshPart28.Position = Vector3.new(-16.2082901, 2.90703535, -30.4102745)
  335. MeshPart28.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  336. MeshPart28.Color = Color3.new(0.992157, 0.917647, 0.552941)
  337. MeshPart28.Transparency = 1
  338. MeshPart28.Size = Vector3.new(1.00027657, 1.26567209, 1.00025082)
  339. MeshPart28.BrickColor = BrickColor.new("Cool yellow")
  340. MeshPart28.CanCollide = false
  341. MeshPart28.brickColor = BrickColor.new("Cool yellow")
  342. Vector3Value29.Name = "OriginalSize"
  343. Vector3Value29.Parent = MeshPart28
  344. Vector3Value29.Value = Vector3.new(1.00027657, 1.26567209, 1.00025082)
  345. Motor6D30.Name = "RightElbow"
  346. Motor6D30.Parent = MeshPart28
  347. Motor6D30.C0 = CFrame.new(0.00214397907, -0.263139546, -0.00944012403, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  348. Motor6D30.C1 = CFrame.new(0.00214457512, 0.122950554, -0.00989595056, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  349. Motor6D30.Part0 = MeshPart22
  350. Motor6D30.Part1 = MeshPart28
  351. Motor6D30.part1 = MeshPart28
  352. MeshPart31.Name = "RightHand"
  353. MeshPart31.Parent = Model0
  354. MeshPart31.CFrame = CFrame.new(-16.202776, 2.1668787, -30.4115677, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  355. MeshPart31.Orientation = Vector3.new(0, 90.1399994, 0)
  356. MeshPart31.Position = Vector3.new(-16.202776, 2.1668787, -30.4115677)
  357. MeshPart31.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  358. MeshPart31.Color = Color3.new(0.992157, 0.917647, 0.552941)
  359. MeshPart31.Transparency = 1
  360. MeshPart31.Size = Vector3.new(0.999299049, 0.335255772, 1.00029743)
  361. MeshPart31.BrickColor = BrickColor.new("Cool yellow")
  362. MeshPart31.CanCollide = false
  363. MeshPart31.brickColor = BrickColor.new("Cool yellow")
  364. Vector3Value32.Name = "OriginalSize"
  365. Vector3Value32.Parent = MeshPart31
  366. Vector3Value32.Value = Vector3.new(0.999299049, 0.335255772, 1.00029743)
  367. Motor6D33.Name = "RightWrist"
  368. Motor6D33.Parent = MeshPart31
  369. Motor6D33.C0 = CFrame.new(0.00214457512, -0.682049513, -0.00989595056, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  370. Motor6D33.C1 = CFrame.new(0.000865101814, 0.058106944, -0.0154390335, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  371. Motor6D33.Part0 = MeshPart28
  372. Motor6D33.Part1 = MeshPart31
  373. Motor6D33.part1 = MeshPart31
  374. MeshPart34.Name = "RightFoot"
  375. MeshPart34.Parent = Model0
  376. MeshPart34.CFrame = CFrame.new(-16.2006416, 0.167736173, -29.4082165, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  377. MeshPart34.Orientation = Vector3.new(0, 90.1399994, 0)
  378. MeshPart34.Position = Vector3.new(-16.2006416, 0.167736173, -29.4082165)
  379. MeshPart34.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  380. MeshPart34.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  381. MeshPart34.Transparency = 1
  382. MeshPart34.Size = Vector3.new(1.00063133, 0.335407376, 1.00020337)
  383. MeshPart34.BrickColor = BrickColor.new("Bright blue")
  384. MeshPart34.CanCollide = false
  385. MeshPart34.brickColor = BrickColor.new("Bright blue")
  386. Vector3Value35.Name = "OriginalSize"
  387. Vector3Value35.Parent = MeshPart34
  388. Vector3Value35.Value = Vector3.new(1.00063133, 0.335407376, 1.00020337)
  389. Motor6D36.Name = "RightAnkle"
  390. Motor6D36.Parent = MeshPart34
  391. Motor6D36.C0 = CFrame.new(0.00382620096, -0.710731506, 0.000283418223, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  392. Motor6D36.C1 = CFrame.new(0.00901681185, 0.0318431854, 0.000155551359, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  393. Motor6D36.Part0 = MeshPart25
  394. Motor6D36.Part1 = MeshPart34
  395. Motor6D36.part1 = MeshPart34
  396. MeshPart37.Name = "LeftFoot"
  397. MeshPart37.Parent = Model0
  398. MeshPart37.CFrame = CFrame.new(-16.1982479, 0.167736173, -28.4166527, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  399. MeshPart37.Orientation = Vector3.new(0, 90.1399994, 0)
  400. MeshPart37.Position = Vector3.new(-16.1982479, 0.167736173, -28.4166527)
  401. MeshPart37.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  402. MeshPart37.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  403. MeshPart37.Transparency = 1
  404. MeshPart37.Size = Vector3.new(1.00063133, 0.335407257, 1.00020337)
  405. MeshPart37.BrickColor = BrickColor.new("Bright blue")
  406. MeshPart37.CanCollide = false
  407. MeshPart37.brickColor = BrickColor.new("Bright blue")
  408. Vector3Value38.Name = "OriginalSize"
  409. Vector3Value38.Parent = MeshPart37
  410. Vector3Value38.Value = Vector3.new(1.00063133, 0.335407257, 1.00020337)
  411. Motor6D39.Name = "LeftAnkle"
  412. Motor6D39.Parent = MeshPart37
  413. Motor6D39.C0 = CFrame.new(-0.00382620096, -0.710131407, 0.00030554086, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  414. Motor6D39.C1 = CFrame.new(-0.00901681185, 0.032443285, 0.000177569687, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  415. Motor6D39.Part0 = MeshPart50
  416. Motor6D39.Part1 = MeshPart37
  417. Motor6D39.part1 = MeshPart37
  418. MeshPart40.Name = "LowerTorso"
  419. MeshPart40.Parent = Model0
  420. MeshPart40.CFrame = CFrame.new(-16.2003231, 2.19284177, -28.9121532, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  421. MeshPart40.Orientation = Vector3.new(0, 90.1399994, 0)
  422. MeshPart40.Position = Vector3.new(-16.2003231, 2.19284177, -28.9121532)
  423. MeshPart40.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  424. MeshPart40.Color = Color3.new(0.156863, 0.498039, 0.278431)
  425. MeshPart40.Transparency = 1
  426. MeshPart40.Size = Vector3.new(2.00017595, 0.400037616, 1.00021255)
  427. MeshPart40.BrickColor = BrickColor.new("Dark green")
  428. MeshPart40.brickColor = BrickColor.new("Dark green")
  429. Vector3Value41.Name = "OriginalSize"
  430. Vector3Value41.Parent = MeshPart40
  431. Vector3Value41.Value = Vector3.new(2.00017595, 0.400037616, 1.00021255)
  432. Motor6D42.Name = "Root"
  433. Motor6D42.Parent = MeshPart40
  434. Motor6D42.C1 = CFrame.new(0.000280171633, 0.133037761, -0.0142721087, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  435. Motor6D42.Part0 = Part10
  436. Motor6D42.Part1 = MeshPart40
  437. Motor6D42.part1 = MeshPart40
  438. Script43.Name = "Damage Script"
  439. Script43.Parent = MeshPart40
  440. table.insert(cors,sandbox(Script43,function()
  441. function onTouched(hit)
  442. local human = hit.Parent:findFirstChild("Humanoid")
  443. if (human ~= nil) then
  444. human.Health = human.Health - 5 -- Change the amount to change the damage.
  445. end
  446. end
  447. script.Parent.Touched:connect(onTouched)
  448. end))
  449. MeshPart44.Name = "LeftUpperLeg"
  450. MeshPart44.Parent = Model0
  451. MeshPart44.CFrame = CFrame.new(-16.1985989, 1.46466565, -28.4114628, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  452. MeshPart44.Orientation = Vector3.new(0, 90.1399994, 0)
  453. MeshPart44.Position = Vector3.new(-16.1985989, 1.46466565, -28.4114628)
  454. MeshPart44.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  455. MeshPart44.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  456. MeshPart44.Transparency = 1
  457. MeshPart44.Size = Vector3.new(1.00027561, 1.5362649, 1.00092912)
  458. MeshPart44.BrickColor = BrickColor.new("Bright blue")
  459. MeshPart44.CanCollide = false
  460. MeshPart44.brickColor = BrickColor.new("Bright blue")
  461. Vector3Value45.Name = "OriginalSize"
  462. Vector3Value45.Parent = MeshPart44
  463. Vector3Value45.Value = Vector3.new(1.00027561, 1.5362649, 1.00092912)
  464. Motor6D46.Name = "LeftHip"
  465. Motor6D46.Parent = MeshPart44
  466. Motor6D46.C0 = CFrame.new(-0.50451982, -0.243062243, 0.00122789107, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  467. Motor6D46.C1 = CFrame.new(-0.00382620096, 0.4851138, 0.000686740503, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  468. Motor6D46.Part0 = MeshPart40
  469. Motor6D46.Part1 = MeshPart44
  470. Motor6D46.part1 = MeshPart44
  471. MeshPart47.Name = "LeftUpperArm"
  472. MeshPart47.Parent = Model0
  473. MeshPart47.CFrame = CFrame.new(-16.2015018, 3.29312539, -27.4145679, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  474. MeshPart47.Orientation = Vector3.new(0, 90.1399994, 0)
  475. MeshPart47.Position = Vector3.new(-16.2015018, 3.29312539, -27.4145679)
  476. MeshPart47.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  477. MeshPart47.Color = Color3.new(0.992157, 0.917647, 0.552941)
  478. MeshPart47.Transparency = 1
  479. MeshPart47.Size = Vector3.new(1.00027633, 1.39554, 1.00025082)
  480. MeshPart47.BrickColor = BrickColor.new("Cool yellow")
  481. MeshPart47.CanCollide = false
  482. MeshPart47.brickColor = BrickColor.new("Cool yellow")
  483. Vector3Value48.Name = "OriginalSize"
  484. Vector3Value48.Parent = MeshPart47
  485. Vector3Value48.Value = Vector3.new(1.00027633, 1.39554, 1.00025082)
  486. Motor6D49.Name = "LeftShoulder"
  487. Motor6D49.Parent = MeshPart47
  488. Motor6D49.C0 = CFrame.new(-1.24955308, 0.556408584, -0.015560925, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  489. Motor6D49.C1 = CFrame.new(0.247964978, 0.456732988, -0.00943991542, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  490. Motor6D49.Part0 = MeshPart13
  491. Motor6D49.Part1 = MeshPart47
  492. Motor6D49.part1 = MeshPart47
  493. MeshPart50.Name = "LeftLowerLeg"
  494. MeshPart50.Parent = Model0
  495. MeshPart50.CFrame = CFrame.new(-16.1983376, 0.910310864, -28.4114628, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  496. MeshPart50.Orientation = Vector3.new(0, 90.1399994, 0)
  497. MeshPart50.Position = Vector3.new(-16.1983376, 0.910310864, -28.4114628)
  498. MeshPart50.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  499. MeshPart50.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  500. MeshPart50.Transparency = 1
  501. MeshPart50.Size = Vector3.new(1.00027585, 1.48964536, 1.00032866)
  502. MeshPart50.BrickColor = BrickColor.new("Bright blue")
  503. MeshPart50.CanCollide = false
  504. MeshPart50.brickColor = BrickColor.new("Bright blue")
  505. Vector3Value51.Name = "OriginalSize"
  506. Vector3Value51.Parent = MeshPart50
  507. Vector3Value51.Value = Vector3.new(1.00027585, 1.48964536, 1.00032866)
  508. Motor6D52.Name = "LeftKnee"
  509. Motor6D52.Parent = MeshPart50
  510. Motor6D52.C0 = CFrame.new(-0.00382620096, -0.264486194, 0.000586740673, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  511. Motor6D52.C1 = CFrame.new(-0.00382620096, 0.289868593, 0.00030554086, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  512. Motor6D52.Part0 = MeshPart44
  513. Motor6D52.Part1 = MeshPart50
  514. Motor6D52.part1 = MeshPart50
  515. MeshPart53.Name = "LeftLowerArm"
  516. MeshPart53.Parent = Model0
  517. MeshPart53.CFrame = CFrame.new(-16.2010593, 2.90703535, -27.4145699, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  518. MeshPart53.Orientation = Vector3.new(0, 90.1399994, 0)
  519. MeshPart53.Position = Vector3.new(-16.2010593, 2.90703535, -27.4145699)
  520. MeshPart53.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  521. MeshPart53.Color = Color3.new(0.992157, 0.917647, 0.552941)
  522. MeshPart53.Transparency = 1
  523. MeshPart53.Size = Vector3.new(1.00027657, 1.26567209, 1.00025082)
  524. MeshPart53.BrickColor = BrickColor.new("Cool yellow")
  525. MeshPart53.CanCollide = false
  526. MeshPart53.brickColor = BrickColor.new("Cool yellow")
  527. Vector3Value54.Name = "OriginalSize"
  528. Vector3Value54.Parent = MeshPart53
  529. Vector3Value54.Value = Vector3.new(1.00027657, 1.26567209, 1.00025082)
  530. Motor6D55.Name = "LeftElbow"
  531. Motor6D55.Parent = MeshPart53
  532. Motor6D55.C0 = CFrame.new(-0.00166511536, -0.263139546, -0.00943991542, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  533. Motor6D55.C1 = CFrame.new(-0.0016657114, 0.122950554, -0.00989592075, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  534. Motor6D55.Part0 = MeshPart47
  535. Motor6D55.Part1 = MeshPart53
  536. Motor6D55.part1 = MeshPart53
  537. MeshPart56.Name = "LeftHand"
  538. MeshPart56.Parent = Model0
  539. MeshPart56.CFrame = CFrame.new(-16.1955395, 2.1668787, -27.4133034, -0.00241400092, 3.49997972e-05, 0.999997497, 0, 1, -3.499991e-05, -0.999997497, -8.44897698e-08, -0.00241400092)
  540. MeshPart56.Orientation = Vector3.new(0, 90.1399994, 0)
  541. MeshPart56.Position = Vector3.new(-16.1955395, 2.1668787, -27.4133034)
  542. MeshPart56.Rotation = Vector3.new(179.169998, 89.8700027, -179.169998)
  543. MeshPart56.Color = Color3.new(0.992157, 0.917647, 0.552941)
  544. MeshPart56.Transparency = 1
  545. MeshPart56.Size = Vector3.new(0.999299049, 0.335255831, 1.00029743)
  546. MeshPart56.BrickColor = BrickColor.new("Cool yellow")
  547. MeshPart56.CanCollide = false
  548. MeshPart56.brickColor = BrickColor.new("Cool yellow")
  549. Vector3Value57.Name = "OriginalSize"
  550. Vector3Value57.Parent = MeshPart56
  551. Vector3Value57.Value = Vector3.new(0.999299049, 0.335255831, 1.00029743)
  552. Motor6D58.Name = "LeftWrist"
  553. Motor6D58.Parent = MeshPart56
  554. Motor6D58.C0 = CFrame.new(-0.0016657114, -0.682255626, -0.00989592075, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  555. Motor6D58.C1 = CFrame.new(-0.000386238098, 0.0579008311, -0.0154390335, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  556. Motor6D58.Part0 = MeshPart53
  557. Motor6D58.Part1 = MeshPart56
  558. Motor6D58.part1 = MeshPart56
  559. Script59.Name = "Respawn"
  560. Script59.Parent = Model0
  561. table.insert(cors,sandbox(Script59,function()
  562. z = script.Parent
  563.  
  564. backup = z:clone()
  565.  
  566. while true do
  567. wait(5)
  568. if z.Zombie.Health == 0 then
  569. z:Remove()
  570. wait(4)
  571. backup.Parent = game.Workspace
  572. backup.Head:MakeJoints()
  573. backup.Torso:MakeJoints()
  574. end
  575. if z == nil then
  576. wait(4)
  577. backup.Parent = game.Workspace
  578. backup.Head:MakeJoints()
  579. backup.Torso:MakeJoints()
  580. end
  581. end
  582. end))
  583. Script60.Name = "Health"
  584. Script60.Parent = Model0
  585. table.insert(cors,sandbox(Script60,function()
  586. --Responsible for regening a player's humanoid's health
  587.  
  588. -- declarations
  589. local Figure = script.Parent
  590. local Head = Figure:WaitForChild("Head")
  591. local Humanoid = Figure:WaitForChild("Humanoid")
  592. local regening = false
  593.  
  594. -- regeneration
  595. function regenHealth()
  596. if regening then return end
  597. regening = true
  598.  
  599. while Humanoid.Health < Humanoid.MaxHealth do
  600. local s = wait(1)
  601. local health = Humanoid.Health
  602. if health > 0 and health < Humanoid.MaxHealth then
  603. local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
  604. health = health + newHealthDelta
  605. Humanoid.Health = math.min(health,Humanoid.MaxHealth)
  606. end
  607. end
  608.  
  609. if Humanoid.Health > Humanoid.MaxHealth then
  610. Humanoid.Health = Humanoid.MaxHealth
  611. end
  612.  
  613. regening = false
  614. end
  615.  
  616. Humanoid.HealthChanged:connect(regenHealth)
  617.  
  618. end))
  619. Script61.Name = "Animate"
  620. Script61.Parent = Model0
  621. table.insert(cors,sandbox(Script61,function()
  622. function waitForChild(parent, childName)
  623. local child = parent:findFirstChild(childName)
  624. if child then return child end
  625. while true do
  626. child = parent.ChildAdded:wait()
  627. if child.Name==childName then return child end
  628. end
  629. end
  630.  
  631. local Figure = script.Parent
  632. local Humanoid = waitForChild(Figure, "Zombie")
  633. local pose = "Standing"
  634.  
  635. local currentAnim = ""
  636. local currentAnimInstance = nil
  637. local currentAnimTrack = nil
  638. local currentAnimKeyframeHandler = nil
  639. local currentAnimSpeed = 1.0
  640. local animTable = {}
  641. local animNames = {
  642. idle = {
  643. { id = "http://www.roblox.com/asset/?id=507766666", weight = 1 },
  644. { id = "http://www.roblox.com/asset/?id=507766951", weight = 1 },
  645. { id = "http://www.roblox.com/asset/?id=507766388", weight = 9 }
  646. },
  647. walk = {
  648. { id = "http://www.roblox.com/asset/?id=507777826", weight = 10 }
  649. },
  650. run = {
  651. { id = "http://www.roblox.com/asset/?id=507767714", weight = 10 }
  652. },
  653. swim = {
  654. { id = "http://www.roblox.com/asset/?id=507784897", weight = 10 }
  655. },
  656. swimidle = {
  657. { id = "http://www.roblox.com/asset/?id=507785072", weight = 10 }
  658. },
  659. jump = {
  660. { id = "http://www.roblox.com/asset/?id=507765000", weight = 10 }
  661. },
  662. fall = {
  663. { id = "http://www.roblox.com/asset/?id=507767968", weight = 10 }
  664. },
  665. climb = {
  666. { id = "http://www.roblox.com/asset/?id=507765644", weight = 10 }
  667. },
  668. sit = {
  669. { id = "http://www.roblox.com/asset/?id=507768133", weight = 10 }
  670. },
  671. toolnone = {
  672. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  673. },
  674. toolslash = {
  675. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  676. -- { id = "slash.xml", weight = 10 }
  677. },
  678. toollunge = {
  679. { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 }
  680. },
  681. wave = {
  682. { id = "http://www.roblox.com/asset/?id=507770239", weight = 10 }
  683. },
  684. point = {
  685. { id = "http://www.roblox.com/asset/?id=507770453", weight = 10 }
  686. },
  687. dance = {
  688. { id = "http://www.roblox.com/asset/?id=507771019", weight = 10 },
  689. { id = "http://www.roblox.com/asset/?id=507771955", weight = 10 },
  690. { id = "http://www.roblox.com/asset/?id=507772104", weight = 10 }
  691. },
  692. dance2 = {
  693. { id = "http://www.roblox.com/asset/?id=507776043", weight = 10 },
  694. { id = "http://www.roblox.com/asset/?id=507776720", weight = 10 },
  695. { id = "http://www.roblox.com/asset/?id=507776879", weight = 10 }
  696. },
  697. dance3 = {
  698. { id = "http://www.roblox.com/asset/?id=507777268", weight = 10 },
  699. { id = "http://www.roblox.com/asset/?id=507777451", weight = 10 },
  700. { id = "http://www.roblox.com/asset/?id=507777623", weight = 10 }
  701. },
  702. laugh = {
  703. { id = "http://www.roblox.com/asset/?id=507770818", weight = 10 }
  704. },
  705. cheer = {
  706. { id = "http://www.roblox.com/asset/?id=507770677", weight = 10 }
  707. },
  708. }
  709.  
  710. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  711. local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  712.  
  713. math.randomseed(tick())
  714.  
  715. function configureAnimationSet(name, fileList)
  716. if (animTable[name] ~= nil) then
  717. for _, connection in pairs(animTable[name].connections) do
  718. connection:disconnect()
  719. end
  720. end
  721. animTable[name] = {}
  722. animTable[name].count = 0
  723. animTable[name].totalWeight = 0
  724. animTable[name].connections = {}
  725.  
  726. -- check for config values
  727. local config = script:FindFirstChild(name)
  728. if (config ~= nil) then
  729. -- print("Loading anims " .. name)
  730. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  731. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  732. local idx = 1
  733. for _, childPart in pairs(config:GetChildren()) do
  734. if (childPart:IsA("Animation")) then
  735. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  736. animTable[name][idx] = {}
  737. animTable[name][idx].anim = childPart
  738. local weightObject = childPart:FindFirstChild("Weight")
  739. if (weightObject == nil) then
  740. animTable[name][idx].weight = 1
  741. else
  742. animTable[name][idx].weight = weightObject.Value
  743. end
  744. animTable[name].count = animTable[name].count + 1
  745. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  746. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  747. idx = idx + 1
  748. end
  749. end
  750. end
  751.  
  752. -- fallback to defaults
  753. if (animTable[name].count <= 0) then
  754. for idx, anim in pairs(fileList) do
  755. animTable[name][idx] = {}
  756. animTable[name][idx].anim = Instance.new("Animation")
  757. animTable[name][idx].anim.Name = name
  758. animTable[name][idx].anim.AnimationId = anim.id
  759. animTable[name][idx].weight = anim.weight
  760. animTable[name].count = animTable[name].count + 1
  761. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  762. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  763. end
  764. end
  765. end
  766.  
  767. -- Setup animation objects
  768. function scriptChildModified(child)
  769. local fileList = animNames[child.Name]
  770. if (fileList ~= nil) then
  771. configureAnimationSet(child.Name, fileList)
  772. end
  773. end
  774.  
  775. script.ChildAdded:connect(scriptChildModified)
  776. script.ChildRemoved:connect(scriptChildModified)
  777.  
  778.  
  779. for name, fileList in pairs(animNames) do
  780. configureAnimationSet(name, fileList)
  781. end
  782.  
  783. -- ANIMATION
  784.  
  785. -- declarations
  786. local toolAnim = "None"
  787. local toolAnimTime = 0
  788.  
  789. local jumpAnimTime = 0
  790. local jumpAnimDuration = 0.31
  791.  
  792. local toolTransitionTime = 0.1
  793. local fallTransitionTime = 0.2
  794.  
  795. -- functions
  796.  
  797. function stopAllAnimations()
  798. local oldAnim = currentAnim
  799.  
  800. -- return to idle if finishing an emote
  801. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  802. oldAnim = "idle"
  803. end
  804.  
  805. currentAnim = ""
  806. currentAnimInstance = nil
  807. if (currentAnimKeyframeHandler ~= nil) then
  808. currentAnimKeyframeHandler:disconnect()
  809. end
  810.  
  811. if (currentAnimTrack ~= nil) then
  812. currentAnimTrack:Stop()
  813. currentAnimTrack:Destroy()
  814. currentAnimTrack = nil
  815. end
  816. return oldAnim
  817. end
  818.  
  819. function setAnimationSpeed(speed)
  820. if speed ~= currentAnimSpeed then
  821. currentAnimSpeed = speed
  822. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  823. end
  824. end
  825.  
  826. function keyFrameReachedFunc(frameName)
  827. if (frameName == "End") then
  828. -- print("Keyframe : ".. frameName)
  829.  
  830. local repeatAnim = currentAnim
  831. -- return to idle if finishing an emote
  832. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  833. repeatAnim = "idle"
  834. end
  835.  
  836. local animSpeed = currentAnimSpeed
  837. playAnimation(repeatAnim, 0.15, Humanoid)
  838. setAnimationSpeed(animSpeed)
  839. end
  840. end
  841.  
  842. -- Preload animations
  843. function playAnimation(animName, transitionTime, humanoid)
  844.  
  845. local roll = math.random(1, animTable[animName].totalWeight)
  846. local origRoll = roll
  847. local idx = 1
  848. while (roll > animTable[animName][idx].weight) do
  849. roll = roll - animTable[animName][idx].weight
  850. idx = idx + 1
  851. end
  852.  
  853. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  854.  
  855. local anim = animTable[animName][idx].anim
  856.  
  857. -- switch animation
  858. if (anim ~= currentAnimInstance) then
  859.  
  860. if (currentAnimTrack ~= nil) then
  861. currentAnimTrack:Stop(transitionTime)
  862. currentAnimTrack:Destroy()
  863. end
  864.  
  865. currentAnimSpeed = 1.0
  866.  
  867. -- load it to the humanoid; get AnimationTrack
  868. currentAnimTrack = humanoid:LoadAnimation(anim)
  869.  
  870. -- play the animation
  871. currentAnimTrack:Play(transitionTime)
  872. currentAnim = animName
  873. currentAnimInstance = anim
  874.  
  875. -- set up keyframe name triggers
  876. if (currentAnimKeyframeHandler ~= nil) then
  877. currentAnimKeyframeHandler:disconnect()
  878. end
  879. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  880.  
  881. end
  882.  
  883. end
  884.  
  885. -------------------------------------------------------------------------------------------
  886. -------------------------------------------------------------------------------------------
  887.  
  888. local toolAnimName = ""
  889. local toolAnimTrack = nil
  890. local toolAnimInstance = nil
  891. local currentToolAnimKeyframeHandler = nil
  892.  
  893. function toolKeyFrameReachedFunc(frameName)
  894. if (frameName == "End") then
  895. -- print("Keyframe : ".. frameName)
  896. playToolAnimation(toolAnimName, 0.0, Humanoid)
  897. end
  898. end
  899.  
  900.  
  901. function playToolAnimation(animName, transitionTime, humanoid)
  902.  
  903. local roll = math.random(1, animTable[animName].totalWeight)
  904. local origRoll = roll
  905. local idx = 1
  906. while (roll > animTable[animName][idx].weight) do
  907. roll = roll - animTable[animName][idx].weight
  908. idx = idx + 1
  909. end
  910. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  911. local anim = animTable[animName][idx].anim
  912.  
  913. if (toolAnimInstance ~= anim) then
  914.  
  915. if (toolAnimTrack ~= nil) then
  916. toolAnimTrack:Stop()
  917. toolAnimTrack:Destroy()
  918. transitionTime = 0
  919. end
  920.  
  921. -- load it to the humanoid; get AnimationTrack
  922. toolAnimTrack = humanoid:LoadAnimation(anim)
  923.  
  924. -- play the animation
  925. toolAnimTrack:Play(transitionTime)
  926. toolAnimName = animName
  927. toolAnimInstance = anim
  928.  
  929. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  930. end
  931. end
  932.  
  933. function stopToolAnimations()
  934. local oldAnim = toolAnimName
  935.  
  936. if (currentToolAnimKeyframeHandler ~= nil) then
  937. currentToolAnimKeyframeHandler:disconnect()
  938. end
  939.  
  940. toolAnimName = ""
  941. toolAnimInstance = nil
  942. if (toolAnimTrack ~= nil) then
  943. toolAnimTrack:Stop()
  944. toolAnimTrack:Destroy()
  945. toolAnimTrack = nil
  946. end
  947.  
  948.  
  949. return oldAnim
  950. end
  951.  
  952. -------------------------------------------------------------------------------------------
  953. -------------------------------------------------------------------------------------------
  954.  
  955.  
  956. function onRunning(speed)
  957. if speed > 0.01 then
  958. local scale = 15.0
  959. playAnimation("walk", 0.1, Humanoid)
  960. setAnimationSpeed(speed / scale)
  961. pose = "Running"
  962. else
  963. playAnimation("idle", 0.1, Humanoid)
  964. pose = "Standing"
  965. end
  966. end
  967.  
  968. function onDied()
  969. pose = "Dead"
  970. end
  971.  
  972. function onJumping()
  973. playAnimation("jump", 0.1, Humanoid)
  974. jumpAnimTime = jumpAnimDuration
  975. pose = "Jumping"
  976. end
  977.  
  978. function onClimbing(speed)
  979. local scale = 5.0
  980. playAnimation("climb", 0.1, Humanoid)
  981. setAnimationSpeed(speed / scale)
  982. pose = "Climbing"
  983. end
  984.  
  985. function onGettingUp()
  986. pose = "GettingUp"
  987. end
  988.  
  989. function onFreeFall()
  990. if (jumpAnimTime <= 0) then
  991. playAnimation("fall", fallTransitionTime, Humanoid)
  992. end
  993. pose = "FreeFall"
  994. end
  995.  
  996. function onFallingDown()
  997. pose = "FallingDown"
  998. end
  999.  
  1000. function onSeated()
  1001. pose = "Seated"
  1002. end
  1003.  
  1004. function onPlatformStanding()
  1005. pose = "PlatformStanding"
  1006. end
  1007.  
  1008. function onSwimming(speed)
  1009. if speed > 1.00 then
  1010. local scale = 10.0
  1011. playAnimation("swim", 0.4, Humanoid)
  1012. setAnimationSpeed(speed / scale)
  1013. pose = "Swimming"
  1014. else
  1015. playAnimation("swimidle", 0.4, Humanoid)
  1016. pose = "Standing"
  1017. end
  1018. end
  1019.  
  1020. function getTool()
  1021. for _, kid in ipairs(Figure:GetChildren()) do
  1022. if kid.className == "Tool" then return kid end
  1023. end
  1024. return nil
  1025. end
  1026.  
  1027. function getToolAnim(tool)
  1028. for _, c in ipairs(tool:GetChildren()) do
  1029. if c.Name == "toolanim" and c.className == "StringValue" then
  1030. return c
  1031. end
  1032. end
  1033. return nil
  1034. end
  1035.  
  1036. function animateTool()
  1037.  
  1038. if (toolAnim == "None") then
  1039. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  1040. return
  1041. end
  1042.  
  1043. if (toolAnim == "Slash") then
  1044. playToolAnimation("toolslash", 0, Humanoid)
  1045. return
  1046. end
  1047.  
  1048. if (toolAnim == "Lunge") then
  1049. playToolAnimation("toollunge", 0, Humanoid)
  1050. return
  1051. end
  1052. end
  1053.  
  1054. function moveSit()
  1055. RightShoulder.MaxVelocity = 0.15
  1056. LeftShoulder.MaxVelocity = 0.15
  1057. RightShoulder:SetDesiredAngle(3.14 /2)
  1058. LeftShoulder:SetDesiredAngle(-3.14 /2)
  1059. RightHip:SetDesiredAngle(3.14 /2)
  1060. LeftHip:SetDesiredAngle(-3.14 /2)
  1061. end
  1062.  
  1063. local lastTick = 0
  1064.  
  1065. function move(time)
  1066. local amplitude = 1
  1067. local frequency = 1
  1068. local deltaTime = time - lastTick
  1069. lastTick = time
  1070.  
  1071. local climbFudge = 0
  1072. local setAngles = false
  1073.  
  1074. if (jumpAnimTime > 0) then
  1075. jumpAnimTime = jumpAnimTime - deltaTime
  1076. end
  1077.  
  1078. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1079. playAnimation("fall", fallTransitionTime, Humanoid)
  1080. elseif (pose == "Seated") then
  1081. playAnimation("sit", 0.5, Humanoid)
  1082. return
  1083. elseif (pose == "Running") then
  1084. playAnimation("walk", 0.1, Humanoid)
  1085. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1086. stopAllAnimations()
  1087. amplitude = 0.1
  1088. frequency = 1
  1089. setAngles = true
  1090. end
  1091.  
  1092. -- Tool Animation handling
  1093. local tool = getTool()
  1094. if tool then
  1095.  
  1096. animStringValueObject = getToolAnim(tool)
  1097.  
  1098. if animStringValueObject then
  1099. toolAnim = animStringValueObject.Value
  1100. -- message recieved, delete StringValue
  1101. animStringValueObject.Parent = nil
  1102. toolAnimTime = time + .3
  1103. end
  1104.  
  1105. if time > toolAnimTime then
  1106. toolAnimTime = 0
  1107. toolAnim = "None"
  1108. end
  1109.  
  1110. animateTool()
  1111. else
  1112. stopToolAnimations()
  1113. toolAnim = "None"
  1114. toolAnimInstance = nil
  1115. toolAnimTime = 0
  1116. end
  1117. end
  1118.  
  1119. -- connect events
  1120. Humanoid.Died:connect(onDied)
  1121. Humanoid.Running:connect(onRunning)
  1122. Humanoid.Jumping:connect(onJumping)
  1123. Humanoid.Climbing:connect(onClimbing)
  1124. Humanoid.GettingUp:connect(onGettingUp)
  1125. Humanoid.FreeFalling:connect(onFreeFall)
  1126. Humanoid.FallingDown:connect(onFallingDown)
  1127. Humanoid.Seated:connect(onSeated)
  1128. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1129. Humanoid.Swimming:connect(onSwimming)
  1130.  
  1131. -- setup emote chat hook
  1132. script.msg.Changed:connect(function(msg)
  1133. script.msg.Value = ""
  1134. local emote = ""
  1135. if (string.sub(msg, 1, 3) == "/e ") then
  1136. emote = string.sub(msg, 4)
  1137. elseif (string.sub(msg, 1, 7) == "/emote ") then
  1138. emote = string.sub(msg, 8)
  1139. end
  1140.  
  1141. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  1142. playAnimation(emote, 0.1, Humanoid)
  1143. end
  1144. -- print("===> " .. string.sub(msg, 1, 3) .. "(" .. emote .. ")")
  1145. end)
  1146.  
  1147.  
  1148. -- main program
  1149.  
  1150. local runService = game:service("RunService");
  1151.  
  1152. -- print("bottom")
  1153.  
  1154. -- initialize to idle
  1155. playAnimation("idle", 0.1, Humanoid)
  1156. pose = "Standing"
  1157.  
  1158. while Figure.Parent~=nil do
  1159. local _, time = wait(0.1)
  1160. move(time)
  1161. end
  1162.  
  1163.  
  1164.  
  1165. end))
  1166. StringValue62.Name = "msg"
  1167. StringValue62.Parent = Script61
  1168. StringValue63.Name = "climb"
  1169. StringValue63.Parent = Script61
  1170. Animation64.Name = "ClimbAnim"
  1171. Animation64.Parent = StringValue63
  1172. Animation64.AnimationId = "http://www.roblox.com/asset/?id=616156119"
  1173. StringValue65.Name = "fall"
  1174. StringValue65.Parent = Script61
  1175. Animation66.Name = "FallAnim"
  1176. Animation66.Parent = StringValue65
  1177. Animation66.AnimationId = "http://www.roblox.com/asset/?id=616157476"
  1178. StringValue67.Name = "idle"
  1179. StringValue67.Parent = Script61
  1180. Animation68.Name = "Animation1"
  1181. Animation68.Parent = StringValue67
  1182. Animation68.AnimationId = "http://www.roblox.com/asset/?id=616158929"
  1183. NumberValue69.Name = "Weight"
  1184. NumberValue69.Parent = Animation68
  1185. NumberValue69.Value = 9
  1186. Animation70.Name = "Animation2"
  1187. Animation70.Parent = StringValue67
  1188. Animation70.AnimationId = "http://www.roblox.com/asset/?id=616160636"
  1189. NumberValue71.Name = "Weight"
  1190. NumberValue71.Parent = Animation70
  1191. NumberValue71.Value = 1
  1192. StringValue72.Name = "jump"
  1193. StringValue72.Parent = Script61
  1194. Animation73.Name = "JumpAnim"
  1195. Animation73.Parent = StringValue72
  1196. Animation73.AnimationId = "http://www.roblox.com/asset/?id=616161997"
  1197. StringValue74.Name = "sit"
  1198. StringValue74.Parent = Script61
  1199. Animation75.Name = "SitAnim"
  1200. Animation75.Parent = StringValue74
  1201. Animation75.AnimationId = "http://www.roblox.com/asset/?id=507768133"
  1202. StringValue76.Name = "swim"
  1203. StringValue76.Parent = Script61
  1204. Animation77.Name = "Swim"
  1205. Animation77.Parent = StringValue76
  1206. Animation77.AnimationId = "http://www.roblox.com/asset/?id=616165109"
  1207. StringValue78.Name = "swimidle"
  1208. StringValue78.Parent = Script61
  1209. Animation79.Name = "SwimIdle"
  1210. Animation79.Parent = StringValue78
  1211. Animation79.AnimationId = "http://www.roblox.com/asset/?id=616166655"
  1212. StringValue80.Name = "toolnone"
  1213. StringValue80.Parent = Script61
  1214. Animation81.Name = "ToolNoneAnim"
  1215. Animation81.Parent = StringValue80
  1216. Animation81.AnimationId = "http://www.roblox.com/asset/?id=507768375"
  1217. StringValue82.Name = "walk"
  1218. StringValue82.Parent = Script61
  1219. Animation83.Name = "RunAnim"
  1220. Animation83.Parent = StringValue82
  1221. Animation83.AnimationId = "http://www.roblox.com/asset/?id=616168032"
  1222. Script84.Name = "SoundScript"
  1223. Script84.Parent = Model0
  1224. table.insert(cors,sandbox(Script84,function()
  1225. local moan = script.Parent.Head.Moan
  1226. local moan2 = script.parent.Head.Moan2
  1227. local moan3 = script.parent.Head.Moan3
  1228. local moan4 = script.Parent.Head.Moan4
  1229.  
  1230. while true do
  1231. moan:Play()
  1232. wait(8)
  1233.  
  1234. moan2:Play()
  1235. wait(5)
  1236.  
  1237. moan3:Play()
  1238. wait(7)
  1239.  
  1240. moan4:Play()
  1241. wait(6)
  1242. end
  1243.  
  1244.  
  1245. local death = script.Parent.Head.Death
  1246.  
  1247.  
  1248. end))
  1249. for i,v in pairs(mas:GetChildren()) do
  1250. v.Parent = workspace
  1251. pcall(function() v:MakeJoints() end)
  1252. end
  1253. mas:Destroy()
  1254. for i,v in pairs(cors) do
  1255. spawn(function()
  1256. pcall(v)
  1257. end)
  1258. end
  1259. end
  1260. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement