Advertisement
roblox1234createscri

Alexa

Feb 23rd, 2020 (edited)
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.45 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Model0 = Instance.new("Model")
  20. Part1 = Instance.new("Part")
  21. SpecialMesh2 = Instance.new("SpecialMesh")
  22. Motor6D3 = Instance.new("Motor6D")
  23. Weld4 = Instance.new("Weld")
  24. Motor6D5 = Instance.new("Motor6D")
  25. Motor6D6 = Instance.new("Motor6D")
  26. Motor6D7 = Instance.new("Motor6D")
  27. Motor6D8 = Instance.new("Motor6D")
  28. ParticleEmitter9 = Instance.new("ParticleEmitter")
  29. ParticleEmitter10 = Instance.new("ParticleEmitter")
  30. ParticleEmitter11 = Instance.new("ParticleEmitter")
  31. ParticleEmitter12 = Instance.new("ParticleEmitter")
  32. Part13 = Instance.new("Part")
  33. SpecialMesh14 = Instance.new("SpecialMesh")
  34. Sound15 = Instance.new("Sound")
  35. Sound16 = Instance.new("Sound")
  36. Part17 = Instance.new("Part")
  37. SpecialMesh18 = Instance.new("SpecialMesh")
  38. Part19 = Instance.new("Part")
  39. SpecialMesh20 = Instance.new("SpecialMesh")
  40. Part21 = Instance.new("Part")
  41. SpecialMesh22 = Instance.new("SpecialMesh")
  42. Part23 = Instance.new("Part")
  43. SpecialMesh24 = Instance.new("SpecialMesh")
  44. Part25 = Instance.new("Part")
  45. SpecialMesh26 = Instance.new("SpecialMesh")
  46. Humanoid27 = Instance.new("Humanoid")
  47. Hat28 = Instance.new("Hat")
  48. Script29 = Instance.new("Script")
  49. BodyColors30 = Instance.new("BodyColors")
  50. Script31 = Instance.new("Script")
  51. StringValue32 = Instance.new("StringValue")
  52. Animation33 = Instance.new("Animation")
  53. StringValue34 = Instance.new("StringValue")
  54. Animation35 = Instance.new("Animation")
  55. StringValue36 = Instance.new("StringValue")
  56. Animation37 = Instance.new("Animation")
  57. NumberValue38 = Instance.new("NumberValue")
  58. Animation39 = Instance.new("Animation")
  59. NumberValue40 = Instance.new("NumberValue")
  60. StringValue41 = Instance.new("StringValue")
  61. Animation42 = Instance.new("Animation")
  62. StringValue43 = Instance.new("StringValue")
  63. Animation44 = Instance.new("Animation")
  64. StringValue45 = Instance.new("StringValue")
  65. Animation46 = Instance.new("Animation")
  66. StringValue47 = Instance.new("StringValue")
  67. Animation48 = Instance.new("Animation")
  68. BrickColorValue49 = Instance.new("BrickColorValue")
  69. Script50 = Instance.new("Script")
  70. Animation51 = Instance.new("Animation")
  71. Sound52 = Instance.new("Sound")
  72. Model0.Name = "Dog"
  73. Model0.Parent = mas
  74. Part1.Name = "Torso"
  75. Part1.Parent = Model0
  76. Part1.CFrame = CFrame.new(-20.9987373, 2.45000553, 49.5617905, 0, 0, 1.00000012, 6.16297582e-33, 1, 0, -1.00000012, -6.16297582e-33, 0)
  77. Part1.Orientation = Vector3.new(0, 90, 0)
  78. Part1.Position = Vector3.new(-20.9987373, 2.45000553, 49.5617905)
  79. Part1.Rotation = Vector3.new(0, 90, 0)
  80. Part1.Color = Color3.new(0.854902, 0.521569, 0.254902)
  81. Part1.Size = Vector3.new(1, 1.5, 3.75)
  82. Part1.BottomSurface = Enum.SurfaceType.Smooth
  83. Part1.BrickColor = BrickColor.new("Bright orange")
  84. Part1.TopSurface = Enum.SurfaceType.Smooth
  85. Part1.brickColor = BrickColor.new("Bright orange")
  86. Part1.FormFactor = Enum.FormFactor.Custom
  87. Part1.formFactor = Enum.FormFactor.Custom
  88. SpecialMesh2.Parent = Part1
  89. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=257307222"
  90. SpecialMesh2.Scale = Vector3.new(1.10000002, 1, 1)
  91. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=255486143"
  92. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  93. Motor6D3.Name = "Tail"
  94. Motor6D3.Parent = Part1
  95. Motor6D3.MaxVelocity = 0.15000000596046
  96. Motor6D3.C0 = CFrame.new(-0.0517863631, -0.0699996948, 1.72020686, 1, 0, 0, 0, -4.37113883e-08, -1, 0, 1, -4.37113883e-08)
  97. Motor6D3.C1 = CFrame.new(0.143782854, -0.172836304, 0.234024048, 0.965675592, -0.252551526, -0.0607320629, 0.0605338626, 0.446179628, -0.892893791, 0.25259909, 0.858569145, 0.446152657)
  98. Motor6D3.Part0 = Part1
  99. Motor6D3.Part1 = Part25
  100. Motor6D3.part1 = Part25
  101. Weld4.Name = "Neck"
  102. Weld4.Parent = Part1
  103. Weld4.C0 = CFrame.new(-5.28991222e-07, -49.9792976, -4.23192978e-06, 1, 2.50387147e-21, -1.16694232e-21, -2.50387147e-21, 1, 9.25738092e-22, 1.16694232e-21, -9.25738092e-22, 1)
  104. Weld4.C1 = CFrame.new(-5.28991222e-07, -50.8292961, 1.37499571, 1, 2.50387147e-21, -1.16694232e-21, -2.50387147e-21, 1, 9.25738092e-22, 1.16694232e-21, -9.25738092e-22, 1)
  105. Weld4.Part0 = Part1
  106. Weld4.Part1 = Part13
  107. Weld4.part1 = Part13
  108. Motor6D5.Name = "Left Hip"
  109. Motor6D5.Parent = Part1
  110. Motor6D5.MaxVelocity = 0.15000000596046
  111. Motor6D5.C0 = CFrame.new(-0.226999998, -1.01200867, 1.20399976, -4.37113883e-08, 0, -1, 0, 1, 0, 1, 0, -4.37113883e-08)
  112. Motor6D5.C1 = CFrame.new(0.125, 0.375, -0.199999928, -4.37113883e-08, -1.16027513e-42, -1, 0, 1, -4.22132457e-29, 1, 0, -4.37113883e-08)
  113. Motor6D5.Part0 = Part1
  114. Motor6D5.Part1 = Part19
  115. Motor6D5.part1 = Part19
  116. Motor6D6.Name = "Left Shoulder"
  117. Motor6D6.Parent = Part1
  118. Motor6D6.MaxVelocity = 0.15000000596046
  119. Motor6D6.C0 = CFrame.new(-0.265000015, -0.725003839, -0.654999971, -4.37113883e-08, 0, -1, 0, 1, 0, 1, 0, -4.37113883e-08)
  120. Motor6D6.C1 = CFrame.new(0.125, 0.775001526, 0.0249999762, -4.37113883e-08, -1.05798034e-42, -1, 0, 1, -4.20018027e-29, 1, 0, -4.37113883e-08)
  121. Motor6D6.Part0 = Part1
  122. Motor6D6.Part1 = Part17
  123. Motor6D6.part1 = Part17
  124. Motor6D7.Name = "Right Hip"
  125. Motor6D7.Parent = Part1
  126. Motor6D7.MaxVelocity = 0.15000000596046
  127. Motor6D7.C0 = CFrame.new(0.48300004, -1.01200867, 1.20399976, -4.37113883e-08, 0, 1, 0, 1, 0, -1, 0, -4.37113883e-08)
  128. Motor6D7.C1 = CFrame.new(0.125, 0.375, -0.199999928, -4.37113883e-08, -1.16027513e-42, 1, 0, 1, -4.22132457e-29, -1, 0, -4.37113883e-08)
  129. Motor6D7.Part0 = Part1
  130. Motor6D7.Part1 = Part23
  131. Motor6D7.part1 = Part23
  132. Motor6D8.Name = "Right Shoulder"
  133. Motor6D8.Parent = Part1
  134. Motor6D8.MaxVelocity = 0.15000000596046
  135. Motor6D8.C0 = CFrame.new(0.52500093, -0.725003839, -0.654999971, -4.37113883e-08, 0, 1, 0, 1, 0, -1, 0, -4.37113883e-08)
  136. Motor6D8.C1 = CFrame.new(0.12500003, 0.775001526, 0.0249999762, -4.37113883e-08, -1.05798034e-42, 1, 0, 1, -4.20018027e-29, -1, 0, -4.37113883e-08)
  137. Motor6D8.Part0 = Part1
  138. Motor6D8.Part1 = Part21
  139. Motor6D8.part1 = Part21
  140. ParticleEmitter9.Name = "Much Bricks"
  141. ParticleEmitter9.Parent = Part1
  142. ParticleEmitter9.Texture = "http://www.roblox.com/asset/?id=242973962"
  143. ParticleEmitter9.Size = NumberSequence.new(5,5)
  144. ParticleEmitter9.Lifetime = NumberRange.new(0.25, 0.5)
  145. ParticleEmitter9.Rate = 0.5
  146. ParticleEmitter10.Name = "Very Fun"
  147. ParticleEmitter10.Parent = Part1
  148. ParticleEmitter10.Texture = "http://www.roblox.com/asset/?id=242974141"
  149. ParticleEmitter10.Size = NumberSequence.new(5,5)
  150. ParticleEmitter10.Lifetime = NumberRange.new(0.25, 0.5)
  151. ParticleEmitter10.Rate = 0.20000000298023
  152. ParticleEmitter11.Name = "Wow"
  153. ParticleEmitter11.Parent = Part1
  154. ParticleEmitter11.Texture = "http://www.roblox.com/asset/?id=242835405"
  155. ParticleEmitter11.Size = NumberSequence.new(5,5)
  156. ParticleEmitter11.Lifetime = NumberRange.new(0.25, 0.5)
  157. ParticleEmitter11.Rate = 0.75
  158. ParticleEmitter12.Name = "Such Hats"
  159. ParticleEmitter12.Parent = Part1
  160. ParticleEmitter12.Texture = "http://www.roblox.com/asset/?id=242974025"
  161. ParticleEmitter12.Size = NumberSequence.new(5,5)
  162. ParticleEmitter12.Lifetime = NumberRange.new(0.25, 0.5)
  163. ParticleEmitter12.Rate = 0.34999999403954
  164. Part13.Name = "Head"
  165. Part13.Parent = Model0
  166. Part13.CFrame = CFrame.new(-22.3737373, 3.30000401, 49.5617905, 0, 0, 1.00000012, 6.16297582e-33, 1, 0, -1.00000012, -6.16297582e-33, 0)
  167. Part13.Orientation = Vector3.new(0, 90, 0)
  168. Part13.Position = Vector3.new(-22.3737373, 3.30000401, 49.5617905)
  169. Part13.Rotation = Vector3.new(0, 90, 0)
  170. Part13.Color = Color3.new(0.854902, 0.521569, 0.254902)
  171. Part13.Size = Vector3.new(1, 0.200000003, 1)
  172. Part13.BottomSurface = Enum.SurfaceType.Smooth
  173. Part13.BrickColor = BrickColor.new("Bright orange")
  174. Part13.TopSurface = Enum.SurfaceType.Smooth
  175. Part13.brickColor = BrickColor.new("Bright orange")
  176. Part13.FormFactor = Enum.FormFactor.Custom
  177. Part13.formFactor = Enum.FormFactor.Custom
  178. SpecialMesh14.Parent = Part13
  179. SpecialMesh14.Scale = Vector3.new(1.10000002, 1, 1)
  180. SpecialMesh14.MeshType = Enum.MeshType.FileMesh
  181. Sound15.Name = "Bite Bark"
  182. Sound15.Parent = Part13
  183. Sound15.SoundId = "http://www.roblox.com/asset/?id=144016898"
  184. Sound15.Volume = 1
  185. Sound16.Name = "Seal Barking"
  186. Sound16.Parent = Part13
  187. Sound16.Looped = true
  188. Sound16.Pitch = 1.3999999761581
  189. Sound16.PlaybackSpeed = 1.3999999761581
  190. Sound16.SoundId = "rbxassetid://315105938"
  191. Sound16.Volume = 1
  192. Part17.Name = "Left Arm"
  193. Part17.Parent = Model0
  194. Part17.CFrame = CFrame.new(-21.6787376, 0.950000167, 49.9517899, 0, 1.8359573e-36, 1.00000012, 6.16297582e-33, 1, 0, -1.00000012, -4.20079717e-29, 0)
  195. Part17.Orientation = Vector3.new(0, 90, 0)
  196. Part17.Position = Vector3.new(-21.6787376, 0.950000167, 49.9517899)
  197. Part17.Rotation = Vector3.new(0, 90, 0)
  198. Part17.Color = Color3.new(0.854902, 0.521569, 0.254902)
  199. Part17.Size = Vector3.new(0.5, 1.9000001, 0.5)
  200. Part17.BottomSurface = Enum.SurfaceType.Smooth
  201. Part17.BrickColor = BrickColor.new("Bright orange")
  202. Part17.CanCollide = false
  203. Part17.TopSurface = Enum.SurfaceType.Smooth
  204. Part17.brickColor = BrickColor.new("Bright orange")
  205. Part17.FormFactor = Enum.FormFactor.Custom
  206. Part17.formFactor = Enum.FormFactor.Custom
  207. SpecialMesh18.Parent = Part17
  208. SpecialMesh18.MeshId = "http://www.roblox.com/asset/?id=257307555"
  209. SpecialMesh18.Offset = Vector3.new(0.0250000004, 0.200000003, 0.75)
  210. SpecialMesh18.TextureId = "http://www.roblox.com/asset/?id=255486143"
  211. SpecialMesh18.MeshType = Enum.MeshType.FileMesh
  212. Part19.Name = "Left Leg"
  213. Part19.Parent = Model0
  214. Part19.CFrame = CFrame.new(-19.594738, 1.06299686, 49.9137917, 0, 1.84519968e-36, 1.00000012, 6.16297582e-33, 1, 0, -1.00000012, -4.22194147e-29, 0)
  215. Part19.Orientation = Vector3.new(0, 90, 0)
  216. Part19.Position = Vector3.new(-19.594738, 1.06299686, 49.9137917)
  217. Part19.Rotation = Vector3.new(0, 90, 0)
  218. Part19.Color = Color3.new(0.854902, 0.521569, 0.254902)
  219. Part19.Size = Vector3.new(0.5, 1.9000001, 0.5)
  220. Part19.BottomSurface = Enum.SurfaceType.Smooth
  221. Part19.BrickColor = BrickColor.new("Bright orange")
  222. Part19.CanCollide = false
  223. Part19.TopSurface = Enum.SurfaceType.Smooth
  224. Part19.brickColor = BrickColor.new("Bright orange")
  225. Part19.FormFactor = Enum.FormFactor.Custom
  226. Part19.formFactor = Enum.FormFactor.Custom
  227. SpecialMesh20.Parent = Part19
  228. SpecialMesh20.MeshId = "http://www.roblox.com/asset/?id=257316977"
  229. SpecialMesh20.Offset = Vector3.new(-0.075000003, -0.100000001, 0)
  230. SpecialMesh20.TextureId = "http://www.roblox.com/asset/?id=255486143"
  231. SpecialMesh20.MeshType = Enum.MeshType.FileMesh
  232. Part21.Name = "Right Arm"
  233. Part21.Parent = Model0
  234. Part21.CFrame = CFrame.new(-21.6787376, 0.950000167, 49.1617889, 0, 1.8359573e-36, 1.00000012, 6.16297582e-33, 1, 0, -1.00000012, 4.19956457e-29, 0)
  235. Part21.Orientation = Vector3.new(0, 90, 0)
  236. Part21.Position = Vector3.new(-21.6787376, 0.950000167, 49.1617889)
  237. Part21.Rotation = Vector3.new(0, 90, 0)
  238. Part21.Color = Color3.new(0.854902, 0.521569, 0.254902)
  239. Part21.Size = Vector3.new(0.5, 1.9000001, 0.5)
  240. Part21.BottomSurface = Enum.SurfaceType.Smooth
  241. Part21.BrickColor = BrickColor.new("Bright orange")
  242. Part21.CanCollide = false
  243. Part21.TopSurface = Enum.SurfaceType.Smooth
  244. Part21.brickColor = BrickColor.new("Bright orange")
  245. Part21.FormFactor = Enum.FormFactor.Custom
  246. Part21.formFactor = Enum.FormFactor.Custom
  247. SpecialMesh22.Parent = Part21
  248. SpecialMesh22.MeshId = "http://www.roblox.com/asset/?id=255485626"
  249. SpecialMesh22.Offset = Vector3.new(-0.0500000007, -0.0500000007, 0)
  250. SpecialMesh22.TextureId = "http://www.roblox.com/asset/?id=255486143"
  251. SpecialMesh22.MeshType = Enum.MeshType.FileMesh
  252. Part23.Name = "Right Leg"
  253. Part23.Parent = Model0
  254. Part23.CFrame = CFrame.new(-19.594738, 1.06299686, 49.2037888, 0, 1.84519968e-36, 1.00000012, 6.16297582e-33, 1, 0, -1.00000012, 4.22070888e-29, 0)
  255. Part23.Orientation = Vector3.new(0, 90, 0)
  256. Part23.Position = Vector3.new(-19.594738, 1.06299686, 49.2037888)
  257. Part23.Rotation = Vector3.new(0, 90, 0)
  258. Part23.Color = Color3.new(0.854902, 0.521569, 0.254902)
  259. Part23.Size = Vector3.new(0.5, 1.9000001, 0.5)
  260. Part23.BottomSurface = Enum.SurfaceType.Smooth
  261. Part23.BrickColor = BrickColor.new("Bright orange")
  262. Part23.CanCollide = false
  263. Part23.TopSurface = Enum.SurfaceType.Smooth
  264. Part23.brickColor = BrickColor.new("Bright orange")
  265. Part23.FormFactor = Enum.FormFactor.Custom
  266. Part23.formFactor = Enum.FormFactor.Custom
  267. SpecialMesh24.Parent = Part23
  268. SpecialMesh24.MeshId = "http://www.roblox.com/asset/?id=257317035"
  269. SpecialMesh24.Offset = Vector3.new(0.075000003, -0.100000001, 0)
  270. SpecialMesh24.TextureId = "http://www.roblox.com/asset/?id=255486143"
  271. SpecialMesh24.MeshType = Enum.MeshType.FileMesh
  272. Part25.Name = "Tail"
  273. Part25.Parent = Model0
  274. Part25.CFrame = CFrame.new(-19.3660278, 2.63000846, 49.801075, -0.252551556, 0.446179718, 0.858569264, 0.0607320741, 0.892893791, -0.446152687, -0.965675712, -0.06053387, -0.25259912)
  275. Part25.Orientation = Vector3.new(26.5, 106.389999, 3.8900001)
  276. Part25.Position = Vector3.new(-19.3660278, 2.63000846, 49.801075)
  277. Part25.Rotation = Vector3.new(119.519997, 59.1599998, -119.510002)
  278. Part25.Size = Vector3.new(0.75, 1, 0.75)
  279. Part25.BottomSurface = Enum.SurfaceType.Smooth
  280. Part25.TopSurface = Enum.SurfaceType.Smooth
  281. Part25.FormFactor = Enum.FormFactor.Custom
  282. Part25.formFactor = Enum.FormFactor.Custom
  283. SpecialMesh26.Parent = Part25
  284. SpecialMesh26.MeshId = "http://www.roblox.com/asset/?id=255485601"
  285. SpecialMesh26.TextureId = "http://www.roblox.com/asset/?id=255486143"
  286. SpecialMesh26.MeshType = Enum.MeshType.FileMesh
  287. Humanoid27.Parent = Model0
  288. Humanoid27.LeftLeg = Part19
  289. Humanoid27.NameOcclusion = Enum.NameOcclusion.NoOcclusion
  290. Humanoid27.RightLeg = Part23
  291. Humanoid27.Torso = Part1
  292. Hat28.Name = "NoHat"
  293. Hat28.Parent = Model0
  294. Script29.Name = "ZombieScript"
  295. Script29.Parent = Model0
  296. table.insert(cors,sandbox(Script29,function()
  297. --Made by Stickmasterluke
  298.  
  299. --Zombie artificial stupidity script
  300.  
  301.  
  302. sp=script.Parent
  303. lastattack=0
  304. nextrandom=0
  305. nextsound=0
  306. nextjump=0
  307. chasing=false
  308.  
  309. variance=4
  310.  
  311. damage=50
  312. attackrange=4.5
  313. sightrange=999--60
  314. runspeed=40
  315. wonderspeed=8
  316. healthregen=false
  317. colors={"Sand red","Dusty Rose","Medium blue","Sand blue","Lavender","Earth green","Brown","Medium stone grey","Brick yellow"}
  318.  
  319. function raycast(spos,vec,currentdist)
  320. local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(spos+(vec*.01),vec*currentdist),script.Parent)
  321. if hit2~=nil and pos2 then
  322. if hit2.Parent==script.Parent and hit2.Transparency>=.8 or hit2.Name=="Handle" or string.sub(hit2.Name,1,6)=="Effect" or hit2.Parent:IsA("Hat") or hit2.Parent:IsA("Tool") or (hit2.Parent:FindFirstChild("Humanoid") and hit2.Parent:FindFirstChild("TEAM") and hit2.Parent:FindFirstChild("TEAM").Value == script.Parent.TEAM.Value) or (not hit2.Parent:FindFirstChild("Humanoid") and hit2.CanCollide==false) then
  323. local currentdist=currentdist-(pos2-spos).magnitude
  324. return raycast(pos2,vec,currentdist)
  325. end
  326. end
  327. return hit2,pos2
  328. end
  329.  
  330. function waitForChild(parent,childName)
  331. local child=parent:findFirstChild(childName)
  332. if child then return child end
  333. while true do
  334. child=parent.ChildAdded:wait()
  335. if child.Name==childName then return child end
  336. end
  337. end
  338.  
  339. -- ANIMATION
  340.  
  341. -- declarations
  342.  
  343. local Torso=waitForChild(sp,"Torso")
  344. local Head=waitForChild(sp,"Head")
  345. local RightShoulder=waitForChild(Torso,"Right Shoulder")
  346. local LeftShoulder=waitForChild(Torso,"Left Shoulder")
  347. local RightHip=waitForChild(Torso,"Right Hip")
  348. local LeftHip=waitForChild(Torso,"Left Hip")
  349. local Neck=waitForChild(Torso,"Tail")
  350. local Humanoid=waitForChild(sp,"Humanoid")
  351. local BodyColors=waitForChild(sp,"Body Colors")
  352. local pose="Standing"
  353. local hitsound=waitForChild(Head,"Bite Bark")
  354. local BARKING=waitForChild(Head,"Seal Barking")
  355.  
  356.  
  357. --[[local sounds={
  358. waitForChild(Torso,"GroanSound"),
  359. waitForChild(Torso,"RawrSound")
  360. }]]
  361.  
  362. if healthregen then
  363. local regenscript=waitForChild(sp,"HealthRegenerationScript")
  364. regenscript.Disabled=false
  365. end
  366. Humanoid.WalkSpeed=wonderspeed
  367.  
  368. local toolAnim="None"
  369. local toolAnimTime=0
  370.  
  371. --[[BodyColors.HeadColor=BrickColor.new("Grime")
  372. local randomcolor1=colors[math.random(1,#colors)]
  373. BodyColors.TorsoColor=BrickColor.new(randomcolor1)
  374. BodyColors.LeftArmColor=BrickColor.new(randomcolor1)
  375. BodyColors.RightArmColor=BrickColor.new(randomcolor1)
  376. local randomcolor2=colors[math.random(1,#colors)]
  377. BodyColors.LeftLegColor=BrickColor.new(randomcolor2)
  378. BodyColors.RightLegColor=BrickColor.new(randomcolor2)]]
  379.  
  380.  
  381. function onRunning(speed)
  382. if speed>0 then
  383. pose="Running"
  384. else
  385. pose="Standing"
  386. end
  387. end
  388. function onDied()
  389. pose="Dead"
  390. end
  391. function onJumping()
  392. pose="Jumping"
  393. end
  394. function onClimbing()
  395. pose="Climbing"
  396. end
  397. function onGettingUp()
  398. pose = "GettingUp"
  399. end
  400. function onFreeFall()
  401. pose = "FreeFall"
  402. end
  403. function onFallingDown()
  404. pose = "FallingDown"
  405. end
  406. function onSeated()
  407. pose = "Seated"
  408. end
  409. function onPlatformStanding()
  410. pose = "PlatformStanding"
  411. end
  412.  
  413. function moveJump()
  414. RightShoulder.MaxVelocity = 0.5
  415. LeftShoulder.MaxVelocity = 0.5
  416. RightShoulder.DesiredAngle=3.14
  417. LeftShoulder.DesiredAngle=-3.14
  418. RightHip.DesiredAngle=0
  419. LeftHip.DesiredAngle=0
  420. end
  421.  
  422. function moveFreeFall()
  423. RightShoulder.MaxVelocity = 0.5
  424. LeftShoulder.MaxVelocity =0.5
  425. RightShoulder.DesiredAngle=3.14
  426. LeftShoulder.DesiredAngle=-3.14
  427. RightHip.DesiredAngle=0
  428. LeftHip.DesiredAngle=0
  429. end
  430.  
  431. function moveSit()
  432. RightShoulder.MaxVelocity = 0.15
  433. LeftShoulder.MaxVelocity = 0.15
  434. RightShoulder.DesiredAngle=3.14 /2
  435. LeftShoulder.DesiredAngle=-3.14 /2
  436. RightHip.DesiredAngle=3.14 /2
  437. LeftHip.DesiredAngle=-3.14 /2
  438. end
  439.  
  440. function animate(time)
  441. local amplitude
  442. local frequency
  443. if (pose == "Jumping") then
  444. moveJump()
  445. return
  446. end
  447. if (pose == "FreeFall") then
  448. moveFreeFall()
  449. return
  450. end
  451. if (pose == "Seated") then
  452. moveSit()
  453. return
  454. end
  455. local climbFudge = 0
  456. if (pose == "Running") then
  457. RightShoulder.MaxVelocity = 0.15
  458. LeftShoulder.MaxVelocity = 0.15
  459. amplitude = 1
  460. frequency = 9
  461. elseif (pose == "Climbing") then
  462. RightShoulder.MaxVelocity = 0.5
  463. LeftShoulder.MaxVelocity = 0.5
  464. amplitude = 1
  465. frequency = 9
  466. climbFudge = 3.14
  467. else
  468. amplitude = 0.1
  469. frequency = 1
  470. end
  471. desiredAngle = amplitude * math.sin(time*frequency)
  472. if not chasing and frequency==9 then
  473. frequency=4
  474. end
  475. if chasing then
  476. --[[RightShoulder.DesiredAngle=math.pi/2
  477. LeftShoulder.DesiredAngle=-math.pi/2
  478. RightHip.DesiredAngle=-desiredAngle*2
  479. LeftHip.DesiredAngle=-desiredAngle*2]]
  480. else
  481. RightShoulder.DesiredAngle=desiredAngle + climbFudge
  482. LeftShoulder.DesiredAngle=desiredAngle - climbFudge
  483. RightHip.DesiredAngle=-desiredAngle
  484. LeftHip.DesiredAngle=-desiredAngle
  485. end
  486. end
  487.  
  488.  
  489. function attack(time,attackpos)
  490. if time-lastattack>=0.25 then
  491. local hit,pos=raycast(Torso.Position,(attackpos-Torso.Position).unit,attackrange)
  492. if hit and hit.Parent~=nil then
  493. local h=hit.Parent:FindFirstChild("Humanoid")
  494. local TEAM=hit.Parent:FindFirstChild("TEAM")
  495. if h and TEAM and TEAM.Value~=sp.TEAM.Value then
  496. local creator=sp:FindFirstChild("creator")
  497. if creator then
  498. if creator.Value~=nil then
  499. if creator.Value~=game.Players:GetPlayerFromCharacter(h.Parent) then
  500. for i,oldtag in ipairs(h:GetChildren()) do
  501. if oldtag.Name=="creator" then
  502. oldtag:remove()
  503. end
  504. end
  505. creator:clone().Parent=h
  506. else
  507. return
  508. end
  509. end
  510. end
  511. hitsound.Volume=1
  512. hitsound.Pitch=.75+(math.random()*.5)
  513. hitsound:Play()
  514. wait(0.15)
  515. h:TakeDamage(damage)
  516. --[[if RightShoulder and LeftShoulder then
  517. RightShoulder.CurrentAngle=0
  518. LeftShoulder.CurrentAngle=0
  519. end]]
  520. end
  521. end
  522. lastattack=time
  523. end
  524. end
  525.  
  526.  
  527. Humanoid.Died:connect(onDied)
  528. Humanoid.Running:connect(onRunning)
  529. Humanoid.Jumping:connect(onJumping)
  530. Humanoid.Climbing:connect(onClimbing)
  531. Humanoid.GettingUp:connect(onGettingUp)
  532. Humanoid.FreeFalling:connect(onFreeFall)
  533. Humanoid.FallingDown:connect(onFallingDown)
  534. Humanoid.Seated:connect(onSeated)
  535. Humanoid.PlatformStanding:connect(onPlatformStanding)
  536.  
  537.  
  538. function populatehumanoids(mdl)
  539. if mdl.ClassName=="Humanoid" then
  540. if mdl.Parent:FindFirstChild("TEAM") and mdl.Parent:FindFirstChild("TEAM").Value~=sp.TEAM.Value then
  541. table.insert(humanoids,mdl)
  542. end
  543. end
  544. for i2,mdl2 in ipairs(mdl:GetChildren()) do
  545. populatehumanoids(mdl2)
  546. end
  547. end
  548.  
  549. --[[function playsound(time)
  550. nextsound=time+5+(math.random()*5)
  551. local randomsound=sounds[math.random(1,#sounds)]
  552. randomsound.Volume=.5+(.5*math.random())
  553. randomsound.Pitch=.5+(.5*math.random())
  554. randomsound:Play()
  555. end]]
  556.  
  557. while sp.Parent~=nil and Humanoid and Humanoid.Parent~=nil and Humanoid.Health>0 and Torso and Head and Torso~=nil and Torso.Parent~=nil do
  558. local _,time=wait(0.25)--wait(1/3)
  559. humanoids={}
  560. populatehumanoids(game.Workspace)
  561. closesttarget=nil
  562. closestdist=sightrange
  563. local creator=sp:FindFirstChild("creator")
  564. for i,h in ipairs(humanoids) do
  565. if h and h.Parent~=nil then
  566. if h.Health>0 and h.Parent~=sp then
  567. local plr=game.Players:GetPlayerFromCharacter(h.Parent)
  568. if creator==nil or plr==nil or creator.Value~=plr then
  569. local t=h.Parent:FindFirstChild("Torso")
  570. if t~=nil then
  571. local dist=(t.Position-Torso.Position).magnitude
  572. if dist<closestdist then
  573. closestdist=dist
  574. closesttarget=t
  575. end
  576. end
  577. end
  578. end
  579. end
  580. end
  581. if closesttarget~=nil then
  582. if not chasing then
  583. --playsound(time)
  584. chasing=true
  585. Humanoid.WalkSpeed=runspeed
  586. BARKING:Play()
  587. end
  588. Humanoid:MoveTo(closesttarget.Position+(Vector3.new(1,1,1)*(variance*((math.random()*2)-1))),closesttarget)
  589. if math.random()<.5 then
  590. attack(time,closesttarget.Position)
  591. end
  592. else
  593. if chasing then
  594. chasing=false
  595. Humanoid.WalkSpeed=wonderspeed
  596. BARKING:Stop()
  597. end
  598. if time>nextrandom then
  599. nextrandom=time+3+(math.random()*5)
  600. local randompos=Torso.Position+((Vector3.new(1,1,1)*math.random()-Vector3.new(.5,.5,.5))*40)
  601. Humanoid:MoveTo(randompos,game.Workspace.Terrain)
  602. end
  603. end
  604. if time>nextsound then
  605. --playsound(time)
  606. end
  607. if time>nextjump then
  608. nextjump=time+7+(math.random()*5)
  609. Humanoid.Jump=true
  610. end
  611. animate(time)
  612. end
  613.  
  614. wait(4)
  615. sp:remove() --Rest In Pizza
  616.  
  617. end))
  618. BodyColors30.Parent = Model0
  619. BodyColors30.HeadColor = BrickColor.new("Bright orange")
  620. BodyColors30.HeadColor3 = Color3.new(0.854902, 0.521569, 0.254902)
  621. BodyColors30.LeftArmColor = BrickColor.new("Bright orange")
  622. BodyColors30.LeftArmColor3 = Color3.new(0.854902, 0.521569, 0.254902)
  623. BodyColors30.LeftLegColor = BrickColor.new("Bright orange")
  624. BodyColors30.LeftLegColor3 = Color3.new(0.854902, 0.521569, 0.254902)
  625. BodyColors30.RightArmColor = BrickColor.new("Bright orange")
  626. BodyColors30.RightArmColor3 = Color3.new(0.854902, 0.521569, 0.254902)
  627. BodyColors30.RightLegColor = BrickColor.new("Bright orange")
  628. BodyColors30.RightLegColor3 = Color3.new(0.854902, 0.521569, 0.254902)
  629. BodyColors30.TorsoColor = BrickColor.new("Bright orange")
  630. BodyColors30.TorsoColor3 = Color3.new(0.854902, 0.521569, 0.254902)
  631. Script31.Name = "Animate"
  632. Script31.Parent = Model0
  633. table.insert(cors,sandbox(Script31,function()
  634. function waitForChild(parent, childName)
  635. local child = parent:findFirstChild(childName)
  636. if child then return child end
  637. while true do
  638. child = parent.ChildAdded:wait()
  639. if child.Name==childName then return child end
  640. end
  641. end
  642.  
  643. local Figure = script.Parent
  644. local Torso = waitForChild(Figure, "Torso")
  645. local RightShoulder = waitForChild(Torso, "Right Shoulder")
  646. local LeftShoulder = waitForChild(Torso, "Left Shoulder")
  647. local RightHip = waitForChild(Torso, "Right Hip")
  648. local LeftHip = waitForChild(Torso, "Left Hip")
  649. local Neck = waitForChild(Torso, "Neck")
  650. local Humanoid = waitForChild(Figure, "Humanoid")
  651. local pose = "Standing"
  652.  
  653. local currentAnim = ""
  654. local currentAnimTrack = nil
  655. local currentAnimKeyframeHandler = nil
  656. local currentAnimSpeed = 1.0
  657. local animTable = {}
  658. local animNames = {
  659. idle = {
  660. { id = "http://www.roblox.com/asset/?id=125750544", weight = 9 },
  661. { id = "http://www.roblox.com/asset/?id=125750618", weight = 1 }
  662. },
  663. walk = {
  664. { id = "http://www.roblox.com/asset/?id=125749145", weight = 10 }
  665. },
  666. run = {
  667. { id = "run.xml", weight = 10 }
  668. },
  669. jump = {
  670. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  671. },
  672. fall = {
  673. { id = "http://www.roblox.com/asset/?id=125750759", weight = 10 }
  674. },
  675. climb = {
  676. { id = "http://www.roblox.com/asset/?id=125750800", weight = 10 }
  677. },
  678. toolnone = {
  679. { id = "http://www.roblox.com/asset/?id=125750867", weight = 10 }
  680. },
  681. toolslash = {
  682. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  683. -- { id = "slash.xml", weight = 10 }
  684. },
  685. toollunge = {
  686. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  687. },
  688. wave = {
  689. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  690. },
  691. point = {
  692. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  693. },
  694. dance = {
  695. { id = "http://www.roblox.com/asset/?id=130018893", weight = 10 },
  696. { id = "http://www.roblox.com/asset/?id=132546839", weight = 10 },
  697. { id = "http://www.roblox.com/asset/?id=132546884", weight = 10 }
  698. },
  699. dance2 = {
  700. { id = "http://www.roblox.com/asset/?id=160934142", weight = 10 },
  701. { id = "http://www.roblox.com/asset/?id=160934298", weight = 10 },
  702. { id = "http://www.roblox.com/asset/?id=160934376", weight = 10 }
  703. },
  704. dance3 = {
  705. { id = "http://www.roblox.com/asset/?id=160934458", weight = 10 },
  706. { id = "http://www.roblox.com/asset/?id=160934530", weight = 10 },
  707. { id = "http://www.roblox.com/asset/?id=160934593", weight = 10 }
  708. },
  709. laugh = {
  710. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  711. },
  712. cheer = {
  713. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  714. },
  715. }
  716.  
  717. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  718. local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  719.  
  720. math.randomseed(tick())
  721.  
  722. function configureAnimationSet(name, fileList)
  723. if (animTable[name] ~= nil) then
  724. for _, connection in pairs(animTable[name].connections) do
  725. connection:disconnect()
  726. end
  727. end
  728. animTable[name] = {}
  729. animTable[name].count = 0
  730. animTable[name].totalWeight = 0
  731. animTable[name].connections = {}
  732.  
  733. -- check for config values
  734. local config = script:FindFirstChild(name)
  735. if (config ~= nil) then
  736. -- print("Loading anims " .. name)
  737. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  738. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  739. local idx = 1
  740. for _, childPart in pairs(config:GetChildren()) do
  741. if (childPart:IsA("Animation")) then
  742. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  743. animTable[name][idx] = {}
  744. animTable[name][idx].anim = childPart
  745. local weightObject = childPart:FindFirstChild("Weight")
  746. if (weightObject == nil) then
  747. animTable[name][idx].weight = 1
  748. else
  749. animTable[name][idx].weight = weightObject.Value
  750. end
  751. animTable[name].count = animTable[name].count + 1
  752. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  753. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  754. idx = idx + 1
  755. end
  756. end
  757. end
  758.  
  759. -- fallback to defaults
  760. if (animTable[name].count <= 0) then
  761. for idx, anim in pairs(fileList) do
  762. animTable[name][idx] = {}
  763. animTable[name][idx].anim = Instance.new("Animation")
  764. animTable[name][idx].anim.Name = name
  765. animTable[name][idx].anim.AnimationId = anim.id
  766. animTable[name][idx].weight = anim.weight
  767. animTable[name].count = animTable[name].count + 1
  768. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  769. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  770. end
  771. end
  772. end
  773.  
  774. -- Setup animation objects
  775. function scriptChildModified(child)
  776. local fileList = animNames[child.Name]
  777. if (fileList ~= nil) then
  778. configureAnimationSet(child.Name, fileList)
  779. end
  780. end
  781.  
  782. script.ChildAdded:connect(scriptChildModified)
  783. script.ChildRemoved:connect(scriptChildModified)
  784.  
  785.  
  786. for name, fileList in pairs(animNames) do
  787. configureAnimationSet(name, fileList)
  788. end
  789.  
  790. -- ANIMATION
  791.  
  792. -- declarations
  793. local toolAnim = "None"
  794. local toolAnimTime = 0
  795.  
  796. local jumpAnimTime = 0
  797. local jumpAnimDuration = 0.3
  798.  
  799. local toolTransitionTime = 0.1
  800. local fallTransitionTime = 0.3
  801. local jumpMaxLimbVelocity = 0.75
  802.  
  803. -- functions
  804.  
  805. function stopAllAnimations()
  806. local oldAnim = currentAnim
  807.  
  808. -- return to idle if finishing an emote
  809. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  810. oldAnim = "idle"
  811. end
  812.  
  813. currentAnim = ""
  814. if (currentAnimKeyframeHandler ~= nil) then
  815. currentAnimKeyframeHandler:disconnect()
  816. end
  817.  
  818. if (currentAnimTrack ~= nil) then
  819. currentAnimTrack:Stop()
  820. currentAnimTrack:Destroy()
  821. currentAnimTrack = nil
  822. end
  823. return oldAnim
  824. end
  825.  
  826. function setAnimationSpeed(speed)
  827. if speed ~= currentAnimSpeed then
  828. currentAnimSpeed = speed
  829. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  830. end
  831. end
  832.  
  833. function keyFrameReachedFunc(frameName)
  834. if (frameName == "End") then
  835. -- print("Keyframe : ".. frameName)
  836. local repeatAnim = stopAllAnimations()
  837. local animSpeed = currentAnimSpeed
  838. playAnimation(repeatAnim, 0.0, Humanoid)
  839. setAnimationSpeed(animSpeed)
  840. end
  841. end
  842.  
  843. -- Preload animations
  844. function playAnimation(animName, transitionTime, humanoid)
  845. local idleFromEmote = (animName == "idle" and emoteNames[currentAnim] ~= nil)
  846. if (animName ~= currentAnim and not idleFromEmote) then
  847.  
  848. if (currentAnimTrack ~= nil) then
  849. currentAnimTrack:Stop(transitionTime)
  850. currentAnimTrack:Destroy()
  851. end
  852.  
  853. currentAnimSpeed = 1.0
  854. local roll = math.random(1, animTable[animName].totalWeight)
  855. local origRoll = roll
  856. local idx = 1
  857. while (roll > animTable[animName][idx].weight) do
  858. roll = roll - animTable[animName][idx].weight
  859. idx = idx + 1
  860. end
  861. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  862. local anim = animTable[animName][idx].anim
  863.  
  864. -- load it to the humanoid; get AnimationTrack
  865. currentAnimTrack = humanoid:LoadAnimation(anim)
  866.  
  867. -- play the animation
  868. currentAnimTrack:Play(transitionTime)
  869. currentAnim = animName
  870.  
  871. -- set up keyframe name triggers
  872. if (currentAnimKeyframeHandler ~= nil) then
  873. currentAnimKeyframeHandler:disconnect()
  874. end
  875. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  876. end
  877. end
  878.  
  879. -------------------------------------------------------------------------------------------
  880. -------------------------------------------------------------------------------------------
  881.  
  882. local toolAnimName = ""
  883. local toolAnimTrack = nil
  884. local currentToolAnimKeyframeHandler = nil
  885.  
  886. function toolKeyFrameReachedFunc(frameName)
  887. if (frameName == "End") then
  888. -- print("Keyframe : ".. frameName)
  889. local repeatAnim = stopToolAnimations()
  890. playToolAnimation(repeatAnim, 0.0, Humanoid)
  891. end
  892. end
  893.  
  894.  
  895. function playToolAnimation(animName, transitionTime, humanoid)
  896. if (animName ~= toolAnimName) then
  897.  
  898. if (toolAnimTrack ~= nil) then
  899. toolAnimTrack:Stop()
  900. toolAnimTrack:Destroy()
  901. transitionTime = 0
  902. end
  903.  
  904. local roll = math.random(1, animTable[animName].totalWeight)
  905. local origRoll = roll
  906. local idx = 1
  907. while (roll > animTable[animName][idx].weight) do
  908. roll = roll - animTable[animName][idx].weight
  909. idx = idx + 1
  910. end
  911. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  912. local anim = animTable[animName][idx].anim
  913.  
  914. -- load it to the humanoid; get AnimationTrack
  915. toolAnimTrack = humanoid:LoadAnimation(anim)
  916.  
  917. -- play the animation
  918. toolAnimTrack:Play(transitionTime)
  919. toolAnimName = animName
  920.  
  921. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  922. end
  923. end
  924.  
  925. function stopToolAnimations()
  926. local oldAnim = toolAnimName
  927.  
  928. if (currentToolAnimKeyframeHandler ~= nil) then
  929. currentToolAnimKeyframeHandler:disconnect()
  930. end
  931.  
  932. toolAnimName = ""
  933. if (toolAnimTrack ~= nil) then
  934. toolAnimTrack:Stop()
  935. toolAnimTrack:Destroy()
  936. toolAnimTrack = nil
  937. end
  938.  
  939.  
  940. return oldAnim
  941. end
  942.  
  943. -------------------------------------------------------------------------------------------
  944. -------------------------------------------------------------------------------------------
  945.  
  946.  
  947. function onRunning(speed)
  948. if speed>0.01 then
  949. playAnimation("walk", 0.1, Humanoid)
  950. pose = "Running"
  951. else
  952. playAnimation("idle", 0.1, Humanoid)
  953. pose = "Standing"
  954. end
  955. end
  956.  
  957. function onDied()
  958. pose = "Dead"
  959. end
  960.  
  961. function onJumping()
  962. playAnimation("jump", 0.1, Humanoid)
  963. jumpAnimTime = jumpAnimDuration
  964. pose = "Jumping"
  965. end
  966.  
  967. function onClimbing(speed)
  968. playAnimation("climb", 0.1, Humanoid)
  969. setAnimationSpeed(speed / 12.0)
  970. pose = "Climbing"
  971. end
  972.  
  973. function onGettingUp()
  974. pose = "GettingUp"
  975. end
  976.  
  977. function onFreeFall()
  978. if (jumpAnimTime <= 0) then
  979. playAnimation("fall", fallTransitionTime, Humanoid)
  980. end
  981. pose = "FreeFall"
  982. end
  983.  
  984. function onFallingDown()
  985. pose = "FallingDown"
  986. end
  987.  
  988. function onSeated()
  989. pose = "Seated"
  990. end
  991.  
  992. function onPlatformStanding()
  993. pose = "PlatformStanding"
  994. end
  995.  
  996. function onSwimming(speed)
  997. if speed>0 then
  998. pose = "Running"
  999. else
  1000. pose = "Standing"
  1001. end
  1002. end
  1003.  
  1004. function getTool()
  1005. for _, kid in ipairs(Figure:GetChildren()) do
  1006. if kid.className == "Tool" then return kid end
  1007. end
  1008. return nil
  1009. end
  1010.  
  1011. function getToolAnim(tool)
  1012. for _, c in ipairs(tool:GetChildren()) do
  1013. if c.Name == "toolanim" and c.className == "StringValue" then
  1014. return c
  1015. end
  1016. end
  1017. return nil
  1018. end
  1019.  
  1020. function animateTool()
  1021.  
  1022. if (toolAnim == "None") then
  1023. playToolAnimation("toolnone", toolTransitionTime, Humanoid)
  1024. return
  1025. end
  1026.  
  1027. if (toolAnim == "Slash") then
  1028. playToolAnimation("toolslash", 0, Humanoid)
  1029. return
  1030. end
  1031.  
  1032. if (toolAnim == "Lunge") then
  1033. playToolAnimation("toollunge", 0, Humanoid)
  1034. return
  1035. end
  1036. end
  1037.  
  1038. function moveSit()
  1039. RightShoulder.MaxVelocity = 0.15
  1040. LeftShoulder.MaxVelocity = 0.15
  1041. RightShoulder:SetDesiredAngle(3.14 /2)
  1042. LeftShoulder:SetDesiredAngle(-3.14 /2)
  1043. RightHip:SetDesiredAngle(3.14 /2)
  1044. LeftHip:SetDesiredAngle(-3.14 /2)
  1045. end
  1046.  
  1047. local lastTick = 0
  1048.  
  1049. function move(time)
  1050. local amplitude = 1
  1051. local frequency = 1
  1052. local deltaTime = time - lastTick
  1053. lastTick = time
  1054.  
  1055. local climbFudge = 0
  1056. local setAngles = false
  1057.  
  1058. if (jumpAnimTime > 0) then
  1059. jumpAnimTime = jumpAnimTime - deltaTime
  1060. end
  1061.  
  1062. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1063. playAnimation("fall", fallTransitionTime, Humanoid)
  1064. elseif (pose == "Seated") then
  1065. stopAllAnimations()
  1066. moveSit()
  1067. return
  1068. elseif (pose == "Running") then
  1069. playAnimation("walk", 0.1, Humanoid)
  1070. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1071. -- print("Wha " .. pose)
  1072. amplitude = 0.1
  1073. frequency = 1
  1074. setAngles = true
  1075. end
  1076.  
  1077. if (setAngles) then
  1078. desiredAngle = amplitude * math.sin(time * frequency)
  1079.  
  1080. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  1081. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  1082. RightHip:SetDesiredAngle(-desiredAngle)
  1083. LeftHip:SetDesiredAngle(-desiredAngle)
  1084. end
  1085.  
  1086. -- Tool Animation handling
  1087. local tool = getTool()
  1088. if tool then
  1089.  
  1090. animStringValueObject = getToolAnim(tool)
  1091.  
  1092. if animStringValueObject then
  1093. toolAnim = animStringValueObject.Value
  1094. -- message recieved, delete StringValue
  1095. animStringValueObject.Parent = nil
  1096. toolAnimTime = time + .3
  1097. end
  1098.  
  1099. if time > toolAnimTime then
  1100. toolAnimTime = 0
  1101. toolAnim = "None"
  1102. end
  1103.  
  1104. animateTool()
  1105. else
  1106. stopToolAnimations()
  1107. toolAnim = "None"
  1108. toolAnimTime = 0
  1109. end
  1110. end
  1111.  
  1112. -- connect events
  1113. Humanoid.Died:connect(onDied)
  1114. Humanoid.Running:connect(onRunning)
  1115. Humanoid.Jumping:connect(onJumping)
  1116. Humanoid.Climbing:connect(onClimbing)
  1117. Humanoid.GettingUp:connect(onGettingUp)
  1118. Humanoid.FreeFalling:connect(onFreeFall)
  1119. Humanoid.FallingDown:connect(onFallingDown)
  1120. Humanoid.Seated:connect(onSeated)
  1121. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1122. Humanoid.Swimming:connect(onSwimming)
  1123.  
  1124. -- setup emote chat hook
  1125.  
  1126.  
  1127. -- main program
  1128.  
  1129. local runService = game:service("RunService");
  1130.  
  1131. -- initialize to idle
  1132. playAnimation("idle", 0.1, Humanoid)
  1133. pose = "Standing"
  1134.  
  1135. while Figure.Parent~=nil do
  1136. local _, time = wait(0.1)
  1137. move(time)
  1138. end
  1139.  
  1140.  
  1141.  
  1142. end))
  1143. StringValue32.Name = "climb"
  1144. StringValue32.Parent = Script31
  1145. Animation33.Name = "ClimbAnim"
  1146. Animation33.Parent = StringValue32
  1147. Animation33.AnimationId = "http://www.roblox.com/asset/?id=125750800"
  1148. StringValue34.Name = "fall"
  1149. StringValue34.Parent = Script31
  1150. Animation35.Name = "FallAnim"
  1151. Animation35.Parent = StringValue34
  1152. Animation35.AnimationId = "http://www.roblox.com/asset/?id=125750759"
  1153. StringValue36.Name = "idle"
  1154. StringValue36.Parent = Script31
  1155. Animation37.Name = "Animation1"
  1156. Animation37.Parent = StringValue36
  1157. Animation37.AnimationId = "http://www.roblox.com/asset/?id=125750544"
  1158. NumberValue38.Name = "Weight"
  1159. NumberValue38.Parent = Animation37
  1160. NumberValue38.Value = 9
  1161. Animation39.Name = "Animation2"
  1162. Animation39.Parent = StringValue36
  1163. Animation39.AnimationId = "http://www.roblox.com/asset/?id=125750618"
  1164. NumberValue40.Name = "Weight"
  1165. NumberValue40.Parent = Animation39
  1166. NumberValue40.Value = 1
  1167. StringValue41.Name = "jump"
  1168. StringValue41.Parent = Script31
  1169. Animation42.Name = "JumpAnim"
  1170. Animation42.Parent = StringValue41
  1171. Animation42.AnimationId = "http://www.roblox.com/asset/?id=125750702"
  1172. StringValue43.Name = "run"
  1173. StringValue43.Parent = Script31
  1174. Animation44.Name = "RunAnim"
  1175. Animation44.Parent = StringValue43
  1176. Animation44.AnimationId = "http://www.roblox.com/asset/?id=125749145"
  1177. StringValue45.Name = "toolnone"
  1178. StringValue45.Parent = Script31
  1179. Animation46.Name = "ToolNoneAnim"
  1180. Animation46.Parent = StringValue45
  1181. Animation46.AnimationId = "rbxassetid://2996823531"
  1182. StringValue47.Name = "walk"
  1183. StringValue47.Parent = Script31
  1184. Animation48.Name = "WalkAnim"
  1185. Animation48.Parent = StringValue47
  1186. Animation48.AnimationId = "http://www.roblox.com/asset/?id=125749145"
  1187. BrickColorValue49.Name = "TEAM"
  1188. BrickColorValue49.Parent = Model0
  1189. BrickColorValue49.Value = BrickColor.new("Bright red")
  1190. Script50.Name = "Sound"
  1191. Script50.Parent = Model0
  1192. table.insert(cors,sandbox(Script50,function()
  1193. -- util
  1194.  
  1195. function waitForChild(parent, childName)
  1196. local child = parent:findFirstChild(childName)
  1197. if child then return child end
  1198. while true do
  1199. child = parent.ChildAdded:wait()
  1200. if child.Name==childName then return child end
  1201. end
  1202. end
  1203.  
  1204. function newSound(id)
  1205. local sound = Instance.new("Sound")
  1206. sound.SoundId = id
  1207. sound.archivable = false
  1208. sound.Parent = script.Parent.Head
  1209. return sound
  1210. end
  1211.  
  1212. -- declarations
  1213.  
  1214. local sDied = newSound("rbxasset://sounds/uuhhh.wav")
  1215. sDied.Pitch = 0.75
  1216. local sFallingDown = newSound("rbxasset://sounds/splat.wav")
  1217. local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
  1218. local sGettingUp = newSound("rbxasset://sounds/hit.wav")
  1219. local sJumping = newSound("rbxasset://sounds/button.wav")
  1220. local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
  1221. sRunning.Looped = true
  1222.  
  1223. local Figure = script.Parent
  1224. local Head = waitForChild(Figure, "Head")
  1225. local Humanoid = waitForChild(Figure, "Humanoid")
  1226.  
  1227. -- functions
  1228.  
  1229. function onDied()
  1230. sDied:Play()
  1231. wait(2.5)
  1232. script.Parent:Destroy()
  1233. end
  1234.  
  1235. function onState(state, sound)
  1236. if state then
  1237. sound:Play()
  1238. else
  1239. sound:Pause()
  1240. end
  1241. end
  1242.  
  1243. function onRunning(speed)
  1244. if speed>0 then
  1245. sRunning:Play()
  1246. else
  1247. sRunning:Pause()
  1248. end
  1249. end
  1250.  
  1251. -- connect up
  1252.  
  1253. Humanoid.Died:connect(onDied)
  1254. Humanoid.Running:connect(onRunning)
  1255. Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
  1256. Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
  1257. Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
  1258. Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)
  1259.  
  1260. end))
  1261. Animation51.Name = "AttackAnim"
  1262. Animation51.Parent = Model0
  1263. Animation51.AnimationId = "http://www.roblox.com/Asset?ID=105211514"
  1264. Sound52.Parent = Model0
  1265. Sound52.SoundId = "rbxassetid://6395511764"
  1266. Sound52.Volume = 10
  1267. for i,v in pairs(mas:GetChildren()) do
  1268. v.Parent = script
  1269. pcall(function() v:MakeJoints() end)
  1270. end
  1271. mas:Destroy()
  1272. for i,v in pairs(cors) do
  1273. spawn(function()
  1274. pcall(v)
  1275. end)
  1276. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement