Advertisement
ERROR_CODE

Beta character fot part 2

Sep 5th, 2023 (edited)
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 45.33 KB | None | 0 0
  1. function sandbox(var,func)
  2.     local env = getfenv(func)
  3.     local newenv = setmetatable({},{
  4.         __index = function(self,k)
  5.             if k=="script" then
  6.                 return var
  7.             else
  8.                 return env[k]
  9.             end
  10.         end,
  11.     })
  12.     setfenv(func,newenv)
  13.     return func
  14. end
  15. cors = {}
  16. mas = Instance.new("Model",game:GetService("Lighting"))
  17. Model0 = Instance.new("Model")
  18. Part1 = Instance.new("Part")
  19. Script2 = Instance.new("Script")
  20. Decal3 = Instance.new("Decal")
  21. Model4 = Instance.new("Model")
  22. Part5 = Instance.new("Part")
  23. SpecialMesh6 = Instance.new("SpecialMesh")
  24. Decal7 = Instance.new("Decal")
  25. Part8 = Instance.new("Part")
  26. Decal9 = Instance.new("Decal")
  27. Motor6D10 = Instance.new("Motor6D")
  28. Motor6D11 = Instance.new("Motor6D")
  29. Motor6D12 = Instance.new("Motor6D")
  30. Motor6D13 = Instance.new("Motor6D")
  31. Motor6D14 = Instance.new("Motor6D")
  32. Part15 = Instance.new("Part")
  33. Part16 = Instance.new("Part")
  34. Part17 = Instance.new("Part")
  35. Part18 = Instance.new("Part")
  36. Humanoid19 = Instance.new("Humanoid")
  37. Part20 = Instance.new("Part")
  38. Sound21 = Instance.new("Sound")
  39. Sound22 = Instance.new("Sound")
  40. Sound23 = Instance.new("Sound")
  41. Sound24 = Instance.new("Sound")
  42. Sound25 = Instance.new("Sound")
  43. Sound26 = Instance.new("Sound")
  44. Sound27 = Instance.new("Sound")
  45. Sound28 = Instance.new("Sound")
  46. Sound29 = Instance.new("Sound")
  47. Motor6D30 = Instance.new("Motor6D")
  48. Script31 = Instance.new("Script")
  49. Script32 = Instance.new("Script")
  50. NumberValue33 = Instance.new("NumberValue")
  51. Script34 = Instance.new("Script")
  52. Sound35 = Instance.new("Sound")
  53. Script36 = Instance.new("Script")
  54. NumberValue37 = Instance.new("NumberValue")
  55. Script38 = Instance.new("Script")
  56. Sound39 = Instance.new("Sound")
  57. Script40 = Instance.new("Script")
  58. NumberValue41 = Instance.new("NumberValue")
  59. Script42 = Instance.new("Script")
  60. Sound43 = Instance.new("Sound")
  61. Script44 = Instance.new("Script")
  62. NumberValue45 = Instance.new("NumberValue")
  63. Script46 = Instance.new("Script")
  64. Sound47 = Instance.new("Sound")
  65. Script48 = Instance.new("Script")
  66. NumberValue49 = Instance.new("NumberValue")
  67. Script50 = Instance.new("Script")
  68. Sound51 = Instance.new("Sound")
  69. Script52 = Instance.new("Script")
  70. Script53 = Instance.new("Script")
  71. Script54 = Instance.new("Script")
  72. Script55 = Instance.new("Script")
  73. Accessory56 = Instance.new("Accessory")
  74. Part57 = Instance.new("Part")
  75. SpecialMesh58 = Instance.new("SpecialMesh")
  76. Vector3Value59 = Instance.new("Vector3Value")
  77. Weld60 = Instance.new("Weld")
  78. BodyColors61 = Instance.new("BodyColors")
  79. Shirt62 = Instance.new("Shirt")
  80. Pants = Instance.new("Pants")
  81. ShirtGraphic63 = Instance.new("ShirtGraphic")
  82. LocalScript64 = Instance.new("LocalScript")
  83. StringValue65 = Instance.new("StringValue")
  84. Animation66 = Instance.new("Animation")
  85. NumberValue67 = Instance.new("NumberValue")
  86. Animation68 = Instance.new("Animation")
  87. NumberValue69 = Instance.new("NumberValue")
  88. StringValue70 = Instance.new("StringValue")
  89. Animation71 = Instance.new("Animation")
  90. StringValue72 = Instance.new("StringValue")
  91. Animation73 = Instance.new("Animation")
  92. StringValue74 = Instance.new("StringValue")
  93. Animation75 = Instance.new("Animation")
  94. StringValue76 = Instance.new("StringValue")
  95. Animation77 = Instance.new("Animation")
  96. StringValue78 = Instance.new("StringValue")
  97. Animation79 = Instance.new("Animation")
  98. StringValue80 = Instance.new("StringValue")
  99. Animation81 = Instance.new("Animation")
  100. StringValue82 = Instance.new("StringValue")
  101. Animation83 = Instance.new("Animation")
  102. NumberValue84 = Instance.new("NumberValue")
  103. local CharacterPart = Instance.new("Part")
  104. CharacterPart.Parent = workspace
  105. CharacterPart.Anchored = true
  106. CharacterPart.Size = Vector3.new(4.935, 3.902, 4.857)
  107. CharacterPart.CanCollide = true
  108. CharacterPart.Position = Vector3.new(117.134, 1666.5, 133.078)
  109. CharacterPart.Transparency = 1
  110. Model0.Name = "Dummy"
  111. Model0.Parent = mas
  112. Model4.Name = "Dummy"
  113. Model4.Parent = Model0
  114. Model4.PrimaryPart = Part5
  115. Part5.Name = "Head"
  116. Part5.Parent = Model4
  117. Part5.CFrame = CFrame.new(-11.8710327, 4.91551495, 9.14945984, 1.00000048, 0, 0, 0, 1, 0, 0, 0, 1.00000048)
  118. Part5.Position = Vector3.new(-11.87103271484375, 4.915514945983887, 9.149459838867188)
  119. Part5.Color = Color3.new(0.972549, 0.85098, 0.427451)
  120. Part5.Size = Vector3.new(2, 1, 1)
  121. Part5.BrickColor = BrickColor.new("Daisy orange")
  122. Part5.TopSurface = Enum.SurfaceType.Smooth
  123. Part5.brickColor = BrickColor.new("Daisy orange")
  124. Part5.FormFactor = Enum.FormFactor.Symmetric
  125. Part5.formFactor = Enum.FormFactor.Symmetric
  126. SpecialMesh6.Parent = Part5
  127. SpecialMesh6.Scale = Vector3.new(1.25, 1.25, 1.25)
  128. Decal7.Name = "face"
  129. Decal7.Parent = Part5
  130. Decal7.Texture = "http://www.roblox.com/asset/?id=180660043"
  131. Part8.Name = "Torso"
  132. Part8.Parent = Model4
  133. Part8.CFrame = CFrame.new(-11.8710327, 3.41551518, 9.14945984, 1.00000048, 0, 0, 0, 1, 0, 0, 0, 1.00000048)
  134. Part8.Position = Vector3.new(-11.87103271484375, 3.415515184402466, 9.149459838867188)
  135. Part8.Size = Vector3.new(2, 2, 1)
  136. Part8.LeftParamA = 0
  137. Part8.LeftParamB = 0
  138. Part8.LeftSurface = Enum.SurfaceType.Weld
  139. Part8.RightParamA = 0
  140. Part8.RightParamB = 0
  141. Part8.RightSurface = Enum.SurfaceType.Weld
  142. Part8.FormFactor = Enum.FormFactor.Symmetric
  143. Part8.formFactor = Enum.FormFactor.Symmetric
  144. Motor6D10.Name = "Right Shoulder"
  145. Motor6D10.Parent = Part8
  146. Motor6D10.MaxVelocity = 0.10000000149011612
  147. Motor6D10.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  148. Motor6D10.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  149. Motor6D10.Part0 = Part8
  150. Motor6D10.Part1 = Part16
  151. Motor6D10.part1 = Part16
  152. Motor6D11.Name = "Left Shoulder"
  153. Motor6D11.Parent = Part8
  154. Motor6D11.MaxVelocity = 0.10000000149011612
  155. Motor6D11.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  156. Motor6D11.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  157. Motor6D11.Part0 = Part8
  158. Motor6D11.Part1 = Part15
  159. Motor6D11.part1 = Part15
  160. Motor6D12.Name = "Right Hip"
  161. Motor6D12.Parent = Part8
  162. Motor6D12.MaxVelocity = 0.10000000149011612
  163. Motor6D12.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  164. Motor6D12.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  165. Motor6D12.Part0 = Part8
  166. Motor6D12.Part1 = Part18
  167. Motor6D12.part1 = Part18
  168. Motor6D13.Name = "Left Hip"
  169. Motor6D13.Parent = Part8
  170. Motor6D13.MaxVelocity = 0.10000000149011612
  171. Motor6D13.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  172. Motor6D13.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  173. Motor6D13.Part0 = Part8
  174. Motor6D13.Part1 = Part17
  175. Motor6D13.part1 = Part17
  176. Motor6D14.Name = "Neck"
  177. Motor6D14.Parent = Part8
  178. Motor6D14.MaxVelocity = 0.10000000149011612
  179. Motor6D14.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  180. Motor6D14.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  181. Motor6D14.Part0 = Part8
  182. Motor6D14.Part1 = Part5
  183. Motor6D14.part1 = Part5
  184. Part15.Name = "Left Arm"
  185. Part15.Parent = Model4
  186. Part15.CFrame = CFrame.new(-13.3710337, 3.41551518, 9.14945984, 1.00000048, 0, 0, 0, 1, 0, 0, 0, 1.00000048)
  187. Part15.Position = Vector3.new(-13.371033668518066, 3.415515184402466, 9.149459838867188)
  188. Part15.Color = Color3.new(0.972549, 0.85098, 0.427451)
  189. Part15.Size = Vector3.new(1, 2, 1)
  190. Part15.BrickColor = BrickColor.new("Daisy orange")
  191. Part15.CanCollide = false
  192. Part15.brickColor = BrickColor.new("Daisy orange")
  193. Part15.FormFactor = Enum.FormFactor.Symmetric
  194. Part15.formFactor = Enum.FormFactor.Symmetric
  195. Part16.Name = "Right Arm"
  196. Part16.Parent = Model4
  197. Part16.CFrame = CFrame.new(-10.3710318, 3.41551518, 9.14945984, 1.00000048, 0, 0, 0, 1, 0, 0, 0, 1.00000048)
  198. Part16.Position = Vector3.new(-10.371031761169434, 3.415515184402466, 9.149459838867188)
  199. Part16.Color = Color3.new(0.972549, 0.85098, 0.427451)
  200. Part16.Size = Vector3.new(1, 2, 1)
  201. Part16.BrickColor = BrickColor.new("Daisy orange")
  202. Part16.CanCollide = false
  203. Part16.brickColor = BrickColor.new("Daisy orange")
  204. Part16.FormFactor = Enum.FormFactor.Symmetric
  205. Part16.formFactor = Enum.FormFactor.Symmetric
  206. Part17.Name = "Left Leg"
  207. Part17.Parent = Model4
  208. Part17.CFrame = CFrame.new(-12.3710327, 1.41551518, 9.14945984, 1.00000048, 0, 0, 0, 1, 0, 0, 0, 1.00000048)
  209. Part17.Position = Vector3.new(-12.37103271484375, 1.4155151844024658, 9.149459838867188)
  210. Part17.Color = Color3.new(0.431373, 0.6, 0.792157)
  211. Part17.Size = Vector3.new(1, 2, 1)
  212. Part17.BottomSurface = Enum.SurfaceType.Smooth
  213. Part17.BrickColor = BrickColor.new("Medium blue")
  214. Part17.CanCollide = false
  215. Part17.brickColor = BrickColor.new("Medium blue")
  216. Part17.FormFactor = Enum.FormFactor.Symmetric
  217. Part17.formFactor = Enum.FormFactor.Symmetric
  218. Part18.Name = "Right Leg"
  219. Part18.Parent = Model4
  220. Part18.CFrame = CFrame.new(-11.3710327, 1.41551518, 9.14945984, 1.00000048, 0, 0, 0, 1, 0, 0, 0, 1.00000048)
  221. Part18.Position = Vector3.new(-11.37103271484375, 1.4155151844024658, 9.149459838867188)
  222. Part18.Color = Color3.new(0.431373, 0.6, 0.792157)
  223. Part18.Size = Vector3.new(1, 2, 1)
  224. Part18.BottomSurface = Enum.SurfaceType.Smooth
  225. Part18.BrickColor = BrickColor.new("Medium blue")
  226. Part18.CanCollide = false
  227. Part18.brickColor = BrickColor.new("Medium blue")
  228. Part18.FormFactor = Enum.FormFactor.Symmetric
  229. Part18.formFactor = Enum.FormFactor.Symmetric
  230. Humanoid19.Parent = Model4
  231. Humanoid19.LeftLeg = Part17
  232. Humanoid19.RightLeg = Part18
  233. Humanoid19.Torso = Part20
  234. Humanoid19.DisplayName = "ERROR_CODE"
  235. Part20.Name = "HumanoidRootPart"
  236. Part20.Parent = Model4
  237. Part20.CFrame = CFrame.new(-11.8710327, 3.41551518, 9.14945984, 1.00000048, 0, 0, 0, 1, 0, 0, 0, 1.00000048)
  238. Part20.Position = Vector3.new(117.134, 1675, 133.078)
  239. Part20.Rotation = Vector3.new(0, 180, 0)
  240. Part20.Transparency = 1
  241. Part20.Size = Vector3.new(2, 2, 1)
  242. Part20.BottomSurface = Enum.SurfaceType.Smooth
  243. Part20.CanCollide = false
  244. Part20.LeftParamA = 0
  245. Part20.LeftParamB = 0
  246. Part20.RightParamA = 0
  247. Part20.RightParamB = 0
  248. Part20.TopSurface = Enum.SurfaceType.Smooth
  249. Part20.FormFactor = Enum.FormFactor.Symmetric
  250. Part20.formFactor = Enum.FormFactor.Symmetric
  251. Sound21.Name = "Climbing"
  252. Sound21.Parent = Part20
  253. Sound21.Looped = true
  254. Sound21.MaxDistance = 150
  255. Sound21.EmitterSize = 5
  256. Sound21.MinDistance = 5
  257. Sound21.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  258. Sound21.Volume = 0.6499999761581421
  259. Sound22.Name = "Died"
  260. Sound22.Parent = Part20
  261. Sound22.MaxDistance = 150
  262. Sound22.EmitterSize = 5
  263. Sound22.MinDistance = 5
  264. Sound22.SoundId = "rbxasset://sounds/uuhhh.mp3"
  265. Sound22.Volume = 0.6499999761581421
  266. Sound23.Name = "GettingUp"
  267. Sound23.Parent = Part20
  268. Sound23.MaxDistance = 150
  269. Sound23.EmitterSize = 5
  270. Sound23.MinDistance = 5
  271. Sound23.SoundId = "rbxasset://sounds/action_get_up.mp3"
  272. Sound23.Volume = 0.6499999761581421
  273. Sound24.Name = "Swimming"
  274. Sound24.Parent = Part20
  275. Sound24.Looped = true
  276. Sound24.MaxDistance = 150
  277. Sound24.EmitterSize = 5
  278. Sound24.MinDistance = 5
  279. Sound24.Pitch = 1.600000023841858
  280. Sound24.PlaybackSpeed = 1.600000023841858
  281. Sound24.SoundId = "rbxasset://sounds/action_swim.mp3"
  282. Sound24.Volume = 0.6499999761581421
  283. Sound25.Name = "Jumping"
  284. Sound25.Parent = Part20
  285. Sound25.MaxDistance = 150
  286. Sound25.EmitterSize = 5
  287. Sound25.MinDistance = 5
  288. Sound25.SoundId = "rbxasset://sounds/action_jump.mp3"
  289. Sound25.Volume = 0.6499999761581421
  290. Sound26.Name = "Landing"
  291. Sound26.Parent = Part20
  292. Sound26.MaxDistance = 150
  293. Sound26.EmitterSize = 5
  294. Sound26.MinDistance = 5
  295. Sound26.SoundId = "rbxasset://sounds/action_jump_land.mp3"
  296. Sound26.Volume = 1
  297. Sound27.Name = "Splash"
  298. Sound27.Parent = Part20
  299. Sound27.MaxDistance = 150
  300. Sound27.EmitterSize = 5
  301. Sound27.MinDistance = 5
  302. Sound27.SoundId = "rbxasset://sounds/impact_water.mp3"
  303. Sound27.Volume = 0.6499999761581421
  304. Sound28.Name = "FreeFalling"
  305. Sound28.Parent = Part20
  306. Sound28.Looped = true
  307. Sound28.MaxDistance = 150
  308. Sound28.EmitterSize = 5
  309. Sound28.MinDistance = 5
  310. Sound28.SoundId = "rbxasset://sounds/action_falling.mp3"
  311. Sound28.Volume = 0.5250001549720764
  312. Sound29.Name = "Running"
  313. Sound29.Parent = Part20
  314. Sound29.Looped = true
  315. Sound29.TimePosition = 1.2636381717898557
  316. Sound29.MaxDistance = 150
  317. Sound29.EmitterSize = 5
  318. Sound29.MinDistance = 5
  319. Sound29.Pitch = 1.850000023841858
  320. Sound29.PlaybackSpeed = 1.850000023841858
  321. Sound29.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  322. Sound29.Volume = 0.6499999761581421
  323. Motor6D30.Name = "RootJoint"
  324. Motor6D30.Parent = Part20
  325. Motor6D30.MaxVelocity = 0.10000000149011612
  326. Motor6D30.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  327. Motor6D30.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  328. Motor6D30.Part0 = Part20
  329. Motor6D30.Part1 = Part8
  330. Motor6D30.part1 = Part8
  331. Script31.Name = "DS"
  332. Script31.Parent = Model4
  333. table.insert(cors,sandbox(Script31,function()
  334. local hum = script.Parent.Humanoid
  335. local blood = game.Lighting.headblood
  336.  
  337. local function Dead()
  338.     blood.Position = script.Parent.Torso.Position
  339.     blood:Clone().Parent = script.Parent.Torso
  340.     wait(.5)
  341.     blood.Position = script.Parent.Torso.Position
  342.     blood:Clone().Parent = script.Parent.Torso
  343.     wait(.5)
  344.     blood.Position = script.Parent.Torso.Position
  345.     blood:Clone().Parent = script.Parent.Torso
  346.     wait(.5)
  347.     blood.Position = script.Parent.Torso.Position
  348.     blood:Clone().Parent = script.Parent.Torso
  349.     wait(.5)
  350.     blood.Position = script.Parent.Torso.Position
  351.     blood:Clone().Parent = script.Parent.Torso
  352.     wait(.5)
  353.     blood.Position = script.Parent.Torso.Position
  354.     blood:Clone().Parent = script.Parent.Torso
  355.     wait(.5)
  356. end
  357.  
  358. hum.Died:Connect(Dead)
  359. end))
  360. Script32.Name = "GoreH"
  361. Script32.Parent = Model4
  362. table.insert(cors,sandbox(Script32,function()
  363. local health = script.Health
  364. local aa = script.HeadDecap
  365. local LA = script.Parent.Head
  366. local Par = game.Lighting.Crush_Particle
  367. local S = script.Gib_Sound
  368. local character = script.Parent
  369.  
  370. LA.Touched:Connect(function(touched)
  371.     if touched.Parent:FindFirstChild("Blade") then
  372.         local blade = touched.Parent.Blade
  373.         if blade.Clicked.Value == true then
  374.             script.Disabled = true
  375.             health.Value -= 10
  376.             if health.Value == 0 then
  377.                 aa.Disabled = false
  378.                 script.Parent.Humanoid.Health = 0
  379.                 local h = Par:Clone()
  380.                 h.Name = 'HeadPar'
  381.                 h.Parent = character.Torso
  382.                 h.Position = character.Torso.Position
  383.                 h.Rotation = character.Torso.Rotation
  384.                 local weld = Instance.new("Weld",character.Torso)
  385.                 weld.Part0 = character.Torso
  386.                 weld.Part1 = h
  387.                 weld.C0 = CFrame.new(0,0.8,0)
  388.                 script.Disabled = true
  389.                 wait(0.1)
  390.                 LA:Destroy()
  391.                 S:Play()
  392.             end
  393.             wait(2)
  394.             script.Disabled = false
  395.         end
  396.     end
  397. end)
  398.  
  399. LA.Touched:Connect(function(touched2)
  400.     if touched2.Parent:FindFirstChild("Explosion") then
  401.         aa.Disabled = false
  402.         script.Parent.Humanoid.Health = 0
  403.         local h = Par:Clone()
  404.         h.Name = 'HeadPar'
  405.         h.Parent = character.Torso
  406.         h.Position = character.Torso.Position
  407.         h.Rotation = character.Torso.Rotation
  408.         local weld = Instance.new("Weld",character.Torso)
  409.         weld.Part0 = character.Torso
  410.         weld.Part1 = h
  411.         weld.C0 = CFrame.new(0,0.8,0)
  412.         script.Disabled = true
  413.         wait(0.1)
  414.         LA:Destroy()
  415.         S:Play()
  416.     end
  417. end)
  418.  
  419. end))
  420. NumberValue33.Name = "Health"
  421. NumberValue33.Parent = Script32
  422. NumberValue33.Value = 40
  423. Script34.Name = "HeadDecap"
  424. Script34.Parent = Script32
  425. table.insert(cors,sandbox(Script34,function()
  426. local p = script.Parent.Parent.Head
  427. local blood = game.Lighting.headblood
  428.  
  429. for i = 1,20 do
  430.     blood.Position = p.Position
  431.     blood:Clone().Parent = workspace.ignore
  432. end
  433. end))
  434. Script34.Disabled = true
  435. Sound35.Name = "Gib_Sound"
  436. Sound35.Parent = Script32
  437. Sound35.SoundId = "rbxassetid://3848986758"
  438. Sound35.Volume = 1
  439. Script36.Name = "GoreLA"
  440. Script36.Parent = Model4
  441. table.insert(cors,sandbox(Script36,function()
  442. local health = script.Health
  443. local aa = script.HeadDecap
  444. local LA = script.Parent ["Left Arm"]
  445. local Bone = game.Lighting.Bone
  446. local S = script.Gib_Sound
  447. local character = script.Parent
  448.  
  449. LA.Touched:Connect(function(touched)
  450.     if touched.Parent:FindFirstChild("Blade") then
  451.         local blade = touched.Parent.Blade
  452.         if blade.Clicked.Value == true then
  453.             script.Disabled = true
  454.             health.Value -= 10
  455.             if health.Value == 0 then
  456.                 aa.Disabled = false
  457.                 script.Parent.Humanoid.Health = 0
  458.                 local h = Bone:Clone()
  459.                 h.Name = 'L_Bone'
  460.                 h.Parent = character.Torso
  461.                 h.Position = character.Torso.Position
  462.                 h.Rotation = character.Torso.Rotation
  463.                 local weld = Instance.new("Weld",character.Torso)
  464.                 weld.Part0 = character.Torso
  465.                 weld.Part1 = h
  466.                 weld.C0 = CFrame.new(-1.2,0.5,0) * CFrame.fromEulerAnglesXYZ(math.rad(0),0,math.rad(360))
  467.                 script.Disabled = true
  468.                 wait(0.1)
  469.                 LA:Destroy()
  470.                 S:Play()
  471.             end
  472.             wait(2)
  473.             script.Disabled = false
  474.             print("Gibed/Script Still Going")
  475.         end
  476.     end
  477. end)
  478.  
  479. LA.Touched:Connect(function(touched2)
  480.     if touched2.Parent:FindFirstChild("Explosion") then
  481.         aa.Disabled = false
  482.         script.Parent.Humanoid.Health = 0
  483.         local h = Bone:Clone()
  484.         h.Name = 'L_Bone'
  485.         h.Parent = character.Torso
  486.         h.Position = character.Torso.Position
  487.         h.Rotation = character.Torso.Rotation
  488.         local weld = Instance.new("Weld",character.Torso)
  489.         weld.Part0 = character.Torso
  490.         weld.Part1 = h
  491.         weld.C0 = CFrame.new(-1.2,0.5,0) * CFrame.fromEulerAnglesXYZ(math.rad(0),0,math.rad(360))
  492.         script.Disabled = true
  493.         wait(0.1)
  494.         LA:Destroy()
  495.         S:Play()
  496.     end
  497. end)
  498.  
  499. end))
  500. NumberValue37.Name = "Health"
  501. NumberValue37.Parent = Script36
  502. NumberValue37.Value = 40
  503. Script38.Name = "HeadDecap"
  504. Script38.Parent = Script36
  505. table.insert(cors,sandbox(Script38,function()
  506. local p = script.Parent.Parent ["Left Arm"]
  507. local blood = game.Lighting.headblood
  508.  
  509. for i = 1,10 do
  510.     blood.Position = p.Position
  511.     blood:Clone().Parent = workspace.ignore
  512. end
  513. end))
  514. Script38.Disabled = true
  515. Sound39.Name = "Gib_Sound"
  516. Sound39.Parent = Script36
  517. Sound39.SoundId = "rbxassetid://3848986758"
  518. Sound39.Volume = 1
  519. Script40.Name = "GoreLL"
  520. Script40.Parent = Model4
  521. table.insert(cors,sandbox(Script40,function()
  522. local health = script.Health
  523. local aa = script.HeadDecap
  524. local LA = script.Parent ["Left Leg"]
  525. local Bone = game.Lighting.L_Gore
  526. local S = script.Gib_Sound
  527. local character = script.Parent
  528.  
  529. LA.Touched:Connect(function(touched)
  530.     if touched.Parent:FindFirstChild("Blade") then
  531.         local blade = touched.Parent.Blade
  532.         if blade.Clicked.Value == true then
  533.             script.Disabled = true
  534.             health.Value -= 10
  535.             if health.Value == 0 then
  536.                 aa.Disabled = false
  537.                 script.Parent.Humanoid.Health = 0
  538.                 local h = Bone:Clone()
  539.                 h.Name = 'LLeg_Bone'
  540.                 h.Parent = character.Torso
  541.                 h.Position = character.Torso.Position
  542.                 h.Rotation = character.Torso.Rotation
  543.                 local weld = Instance.new("Weld",character.Torso)
  544.                 weld.Part0 = character.Torso
  545.                 weld.Part1 = h
  546.                 weld.C0 = CFrame.new(-0.5,-1,0)
  547.                 script.Disabled = true
  548.                 wait(0.1)
  549.                 LA:Destroy()
  550.                 S:Play()
  551.             end
  552.             wait(2)
  553.             script.Disabled = false
  554.         end
  555.     end
  556. end)
  557.  
  558. LA.Touched:Connect(function(touched2)
  559.     if touched2.Parent:FindFirstChild("Explosion") then
  560.         aa.Disabled = false
  561.         script.Parent.Humanoid.Health = 0
  562.         local h = Bone:Clone()
  563.         h.Name = 'LLeg_Bone'
  564.         h.Parent = character.Torso
  565.         h.Position = character.Torso.Position
  566.         h.Rotation = character.Torso.Rotation
  567.         local weld = Instance.new("Weld",character.Torso)
  568.         weld.Part0 = character.Torso
  569.         weld.Part1 = h
  570.         weld.C0 = CFrame.new(-0.5,-1,0)
  571.         script.Disabled = true
  572.         wait(0.1)
  573.         LA:Destroy()
  574.         S:Play()
  575.     end
  576. end)
  577.  
  578. end))
  579. NumberValue41.Name = "Health"
  580. NumberValue41.Parent = Script40
  581. NumberValue41.Value = 40
  582. Script42.Name = "HeadDecap"
  583. Script42.Parent = Script40
  584. table.insert(cors,sandbox(Script42,function()
  585. local p = script.Parent.Parent ["Left Leg"]
  586. local blood = game.Lighting.headblood
  587.  
  588. for i = 1,10 do
  589.     blood.Position = p.Position
  590.     blood:Clone().Parent = workspace.ignore
  591. end
  592. end))
  593. Script42.Disabled = true
  594. Sound43.Name = "Gib_Sound"
  595. Sound43.Parent = Script40
  596. Sound43.SoundId = "rbxassetid://3848986758"
  597. Sound43.Volume = 1
  598. Script44.Name = "GoreRA"
  599. Script44.Parent = Model4
  600. table.insert(cors,sandbox(Script44,function()
  601. local health = script.Health
  602. local aa = script.HeadDecap
  603. local LA = script.Parent ["Right Arm"]
  604. local Bone = game.Lighting.Bone
  605. local S = script.Gib_Sound
  606. local character = script.Parent
  607.  
  608. LA.Touched:Connect(function(touched)
  609.     if touched.Parent:FindFirstChild("Blade") then
  610.         local blade = touched.Parent.Blade
  611.         if blade.Clicked.Value == true then
  612.             script.Disabled = true
  613.             health.Value -= 10
  614.             if health.Value == 0 then
  615.                 aa.Disabled = false
  616.                 script.Parent.Humanoid.Health = 0
  617.                 local h = Bone:Clone()
  618.                 h.Name = 'R_Bone'
  619.                 h.Parent = character.Torso
  620.                 h.Position = character.Torso.Position
  621.                 h.Rotation = character.Torso.Rotation
  622.                 local weld = Instance.new("Weld",character.Torso)
  623.                 weld.Part0 = character.Torso
  624.                 weld.Part1 = h
  625.                 weld.C0 = CFrame.new(1.2,0.5,0) * CFrame.fromEulerAnglesXYZ(math.rad(0),0,math.rad(180))
  626.                 script.Disabled = true
  627.                 wait(0.1)
  628.                 LA:Destroy()
  629.                 S:Play()
  630.             end
  631.             wait(2)
  632.             script.Disabled = false
  633.         end
  634.     end
  635. end)
  636.  
  637. LA.Touched:Connect(function(touched2)
  638.     if touched2.Parent:FindFirstChild("Explosion") then
  639.         aa.Disabled = false
  640.         script.Parent.Humanoid.Health = 0
  641.         local h = Bone:Clone()
  642.         h.Name = 'R_Bone'
  643.         h.Parent = character.Torso
  644.         h.Position = character.Torso.Position
  645.         h.Rotation = character.Torso.Rotation
  646.         local weld = Instance.new("Weld",character.Torso)
  647.         weld.Part0 = character.Torso
  648.         weld.Part1 = h
  649.         weld.C0 = CFrame.new(1.2,0.5,0) * CFrame.fromEulerAnglesXYZ(math.rad(0),0,math.rad(180))
  650.         script.Disabled = true
  651.         wait(0.1)
  652.         LA:Destroy()
  653.         S:Play()
  654.     end
  655. end)
  656.  
  657. end))
  658. NumberValue45.Name = "Health"
  659. NumberValue45.Parent = Script44
  660. NumberValue45.Value = 40
  661. Script46.Name = "HeadDecap"
  662. Script46.Parent = Script44
  663. table.insert(cors,sandbox(Script46,function()
  664. local p = script.Parent.Parent ["Right Arm"]
  665. local blood = game.Lighting.headblood
  666.  
  667. for i = 1,10 do
  668.     blood.Position = p.Position
  669.     blood:Clone().Parent = workspace.ignore
  670. end
  671. end))
  672. Script46.Disabled = true
  673. Sound47.Name = "Gib_Sound"
  674. Sound47.Parent = Script44
  675. Sound47.SoundId = "rbxassetid://3848986758"
  676. Sound47.Volume = 1
  677. Script48.Name = "GoreRL"
  678. Script48.Parent = Model4
  679. table.insert(cors,sandbox(Script48,function()
  680. local health = script.Health
  681. local aa = script.HeadDecap
  682. local LA = script.Parent ["Right Leg"]
  683. local Bone = game.Lighting.L_Gore
  684. local S = script.Gib_Sound
  685. local character = script.Parent
  686.  
  687. LA.Touched:Connect(function(touched)
  688.     if touched.Parent:FindFirstChild("Blade") then
  689.         local blade = touched.Parent.Blade
  690.         if blade.Clicked.Value == true then
  691.             script.Disabled = true
  692.             health.Value -= 10
  693.             if health.Value == 0 then
  694.                 aa.Disabled = false
  695.                 script.Parent.Humanoid.Health = 0
  696.                 local h = Bone:Clone()
  697.                 h.Name = 'RLeg_Bone'
  698.                 h.Parent = character.Torso
  699.                 h.Position = character.Torso.Position
  700.                 h.Rotation = character.Torso.Rotation
  701.                 local weld = Instance.new("Weld",character.Torso)
  702.                 weld.Part0 = character.Torso
  703.                 weld.Part1 = h
  704.                 weld.C0 = CFrame.new(0.5,-1,0)
  705.                 script.Disabled = true
  706.                 wait(0.1)
  707.                 LA:Destroy()
  708.                 S:Play()
  709.             end
  710.             wait(2)
  711.             script.Disabled = false
  712.         end
  713.     end
  714. end)
  715.  
  716. LA.Touched:Connect(function(touched2)
  717.     if touched2.Parent:FindFirstChild("Explosion") then
  718.         aa.Disabled = false
  719.         script.Parent.Humanoid.Health = 0
  720.         local h = Bone:Clone()
  721.         h.Name = 'RLeg_Bone'
  722.         h.Parent = character.Torso
  723.         h.Position = character.Torso.Position
  724.         h.Rotation = character.Torso.Rotation
  725.         local weld = Instance.new("Weld",character.Torso)
  726.         weld.Part0 = character.Torso
  727.         weld.Part1 = h
  728.         weld.C0 = CFrame.new(0.5,-1,0)
  729.         script.Disabled = true
  730.         wait(0.1)
  731.         LA:Destroy()
  732.         S:Play()
  733.     end
  734. end)
  735.  
  736. end))
  737. NumberValue49.Name = "Health"
  738. NumberValue49.Parent = Script48
  739. NumberValue49.Value = 40
  740. Script50.Name = "HeadDecap"
  741. Script50.Parent = Script48
  742. table.insert(cors,sandbox(Script50,function()
  743. local p = script.Parent.Parent ["Right Leg"]
  744. local blood = game.Lighting.headblood
  745.  
  746. for i = 1,10 do
  747.     blood.Position = p.Position
  748.     blood:Clone().Parent = workspace.ignore
  749. end
  750. end))
  751. Script50.Disabled = true
  752. Sound51.Name = "Gib_Sound"
  753. Sound51.Parent = Script48
  754. Sound51.SoundId = "rbxassetid://3848986758"
  755. Sound51.Volume = 1
  756. Script52.Name = "HeadBlood"
  757. Script52.Parent = Model4
  758. table.insert(cors,sandbox(Script52,function()
  759. local p = script.Parent.Head
  760. local hb = game.Lighting.headblood
  761.  
  762. p.Touched:Connect(function(hitPart)
  763.     if hitPart.Parent:FindFirstChild("KBlade") then
  764.         hb.Position = p.Position
  765.         hb:Clone().Parent = p
  766.         wait(0.5)
  767.         hb.Position = p.Position
  768.         hb:Clone().Parent = p
  769.         wait(0.5)
  770.         hb.Position = p.Position
  771.         hb:Clone().Parent = p
  772.         wait(0.5)
  773.         hb.Position = p.Position
  774.         hb:Clone().Parent = p
  775.         wait(0.5)
  776.         hb.Position = p.Position
  777.         hb:Clone().Parent = p
  778.         wait(0.5)
  779.         hb.Position = p.Position
  780.         hb:Clone().Parent = p
  781.         wait(0.5)
  782.     end
  783. end)
  784. end))
  785. Script53.Name = "IgnoreTable"
  786. Script53.Parent = Model4
  787. table.insert(cors,sandbox(Script53,function()
  788. wait(1)
  789. print("Blood Made By Frost_Mallow and FLAMGOik")
  790. script.Parent.Parent = workspace.ignore
  791. end))
  792. Script54.Name = "NewMain"
  793. Script54.Parent = Model4
  794. table.insert(cors,sandbox(Script54,function()
  795. local hum = script.Parent.Humanoid
  796.  
  797. local enabled = true
  798. local oldHP = hum.Health
  799. function OnHP(hp)
  800.     if enabled == false then return end
  801.     local dmg = oldHP - hp
  802.     if dmg >=3 and hum.Health > 0 then
  803.         enabled = false
  804.         for i = 1, 2 do
  805.             local copy = game.Lighting.headblood:Clone()
  806.             copy.Position = script.Parent.Torso.Position + Vector3.new(0,1.5,0)
  807.             copy.Parent = workspace.ignore
  808.             wait(0.1)
  809.         end
  810.  
  811.     end
  812.     wait(0.5)
  813.     oldHP = hum.Health
  814.     enabled = true
  815. end
  816. hum.HealthChanged:connect(OnHP)
  817. end))
  818. Script55.Name = "Health"
  819. Script55.Parent = Model4
  820. table.insert(cors,sandbox(Script55,function()
  821. -- Gradually regenerates the Humanoid's Health over time.
  822.  
  823. local REGEN_RATE = 1/100 -- Regenerate this fraction of MaxHealth per second.
  824. local REGEN_STEP = 1 -- Wait this long between each regeneration step.
  825.  
  826. --------------------------------------------------------------------------------
  827.  
  828. local Character = script.Parent
  829. local Humanoid = Character:WaitForChild'Humanoid'
  830.  
  831. --------------------------------------------------------------------------------
  832.  
  833. while true do
  834.     while Humanoid.Health < Humanoid.MaxHealth do
  835.         local dt = wait(REGEN_STEP)
  836.         local dh = dt*REGEN_RATE*Humanoid.MaxHealth
  837.         Humanoid.Health = math.min(Humanoid.Health + dh, Humanoid.MaxHealth)
  838.     end
  839.     Humanoid.HealthChanged:Wait()
  840. end
  841. end))
  842. Accessory56.Name = "Horns"
  843. Accessory56.Parent = Model4
  844. Accessory56.AttachmentPoint = CFrame.new(0, 0.0900000036, 0.180000007, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  845. Accessory56.AttachmentPos = Vector3.new(0, 0.09000000357627869, 0.18000000715255737)
  846. Part57.Name = "Handle"
  847. Part57.Parent = Accessory56
  848. Part57.CFrame = CFrame.new(-11.8710327, 5.32551479, 8.96973228, 1.00000048, 0, 0, 0, 1, 0, 0, 0, 1.00000048)
  849. Part57.Position = Vector3.new(-11.87103271484375, 5.325514793395996, 8.969732284545898)
  850. Part57.Size = Vector3.new(1, 0.4000000059604645, 1)
  851. Part57.BottomSurface = Enum.SurfaceType.Smooth
  852. Part57.CanCollide = false
  853. Part57.TopSurface = Enum.SurfaceType.Smooth
  854. Part57.FormFactor = Enum.FormFactor.Plate
  855. Part57.formFactor = Enum.FormFactor.Plate
  856. SpecialMesh58.Parent = Part57
  857. SpecialMesh58.MeshId = "http://www.roblox.com/asset/?id="
  858. SpecialMesh58.TextureId = "http://www.roblox.com/asset/?id=8214898142"
  859. SpecialMesh58.Scale = Vector3.new(1.0199999809265137, 1.0199999809265137, 1.0199999809265137)
  860. SpecialMesh58.TextureId = "rbxassetid://2646470932"
  861. SpecialMesh58.MeshType = Enum.MeshType.FileMesh
  862. Vector3Value59.Name = "OriginalSize"
  863. Vector3Value59.Parent = Part57
  864. Vector3Value59.Value = Vector3.new(1, 0.4000000059604645, 1)
  865. Weld60.Name = "AccessoryWeld"
  866. Weld60.Parent = Part57
  867. Weld60.C0 = CFrame.new(8.65838956e-09, 0.190000057, 0.179727763, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  868. Weld60.C1 = CFrame.new(0, 0.600000024, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  869. Weld60.Part0 = Part57
  870. Weld60.Part1 = Part5
  871. Weld60.part1 = Part5
  872. BodyColors61.Parent = Model4
  873. BodyColors61.HeadColor = BrickColor.new("Really black")
  874. BodyColors61.HeadColor3 = Color3.new(0, 0, 0)
  875. BodyColors61.LeftArmColor = BrickColor.new("Really black")
  876. BodyColors61.LeftArmColor3 = Color3.new(0, 0, 0)
  877. BodyColors61.LeftLegColor = BrickColor.new("Really black")
  878. BodyColors61.LeftLegColor3 = Color3.new(0, 0, 0)
  879. BodyColors61.RightArmColor = BrickColor.new("Really black")
  880. BodyColors61.RightArmColor3 = Color3.new(0, 0, 0)
  881. BodyColors61.RightLegColor = BrickColor.new("Really black")
  882. BodyColors61.RightLegColor3 = Color3.new(0, 0, 0)
  883. BodyColors61.TorsoColor = BrickColor.new("Really black")
  884. BodyColors61.TorsoColor3 = Color3.new(0, 0, 0)
  885. Shirt62.Name = "Shirt"
  886. Shirt62.Parent = Model4
  887. Shirt62.ShirtTemplate = "http://www.roblox.com/asset/?id=6696363386"
  888. Pants.Name = "Pants"
  889. Pants.Parent = Model4
  890. Pants.PantsTemplate = "http://www.roblox.com/asset/?id=129459076"
  891. LocalScript64.Name = "Animate"
  892. LocalScript64.Parent = Model4
  893. table.insert(cors,sandbox(LocalScript64,function()
  894. local Figure = script.Parent
  895. local Torso = Figure:WaitForChild("Torso")
  896. local RightShoulder = Torso:WaitForChild("Right Shoulder")
  897. local LeftShoulder = Torso:WaitForChild("Left Shoulder")
  898. local RightHip = Torso:WaitForChild("Right Hip")
  899. local LeftHip = Torso:WaitForChild("Left Hip")
  900. local Neck = Torso:WaitForChild("Neck")
  901. local Humanoid = Figure:WaitForChild("Humanoid")
  902. local pose = "Standing"
  903.  
  904. local currentAnim = ""
  905. local currentAnimInstance = nil
  906. local currentAnimTrack = nil
  907. local currentAnimKeyframeHandler = nil
  908. local currentAnimSpeed = 1.0
  909. local animTable = {}
  910. local animNames = {
  911.     idle =  {  
  912.                 { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  913.                 { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  914.             },
  915.     walk =  {  
  916.                 { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  917.             },
  918.     run =   {
  919.                 { id = "run.xml", weight = 10 }
  920.             },
  921.     jump =  {
  922.                 { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  923.             },
  924.     fall =  {
  925.                 { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  926.             },
  927.     climb = {
  928.                 { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  929.             },
  930.     sit =   {
  931.                 { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  932.             }, 
  933.     toolnone = {
  934.                 { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  935.             },
  936.     toolslash = {
  937.                 { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  938. --              { id = "slash.xml", weight = 10 }
  939.             },
  940.     toollunge = {
  941.                 { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  942.             },
  943.     wave = {
  944.                 { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  945.             },
  946.     point = {
  947.                 { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  948.             },
  949.     dance1 = {
  950.                 { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  951.                 { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  952.                 { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  953.             },
  954.     dance2 = {
  955.                 { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  956.                 { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  957.                 { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  958.             },
  959.     dance3 = {
  960.                 { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  961.                 { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  962.                 { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  963.             },
  964.     laugh = {
  965.                 { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  966.             },
  967.     cheer = {
  968.                 { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  969.             },
  970. }
  971. local dances = {"dance1", "dance2", "dance3"}
  972.  
  973. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  974. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  975.  
  976. function configureAnimationSet(name, fileList)
  977.     if (animTable[name] ~= nil) then
  978.         for _, connection in pairs(animTable[name].connections) do
  979.             connection:disconnect()
  980.         end
  981.     end
  982.     animTable[name] = {}
  983.     animTable[name].count = 0
  984.     animTable[name].totalWeight = 0
  985.     animTable[name].connections = {}
  986.  
  987.     -- check for config values
  988.     local config = script:FindFirstChild(name)
  989.     if (config ~= nil) then
  990. --      print("Loading anims " .. name)
  991.         table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  992.         table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  993.         local idx = 1
  994.         for _, childPart in pairs(config:GetChildren()) do
  995.             if (childPart:IsA("Animation")) then
  996.                 table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  997.                 animTable[name][idx] = {}
  998.                 animTable[name][idx].anim = childPart
  999.                 local weightObject = childPart:FindFirstChild("Weight")
  1000.                 if (weightObject == nil) then
  1001.                     animTable[name][idx].weight = 1
  1002.                 else
  1003.                     animTable[name][idx].weight = weightObject.Value
  1004.                 end
  1005.                 animTable[name].count = animTable[name].count + 1
  1006.                 animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  1007.     --          print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  1008.                 idx = idx + 1
  1009.             end
  1010.         end
  1011.     end
  1012.  
  1013.     -- fallback to defaults
  1014.     if (animTable[name].count <= 0) then
  1015.         for idx, anim in pairs(fileList) do
  1016.             animTable[name][idx] = {}
  1017.             animTable[name][idx].anim = Instance.new("Animation")
  1018.             animTable[name][idx].anim.Name = name
  1019.             animTable[name][idx].anim.AnimationId = anim.id
  1020.             animTable[name][idx].weight = anim.weight
  1021.             animTable[name].count = animTable[name].count + 1
  1022.             animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  1023. --          print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  1024.         end
  1025.     end
  1026. end
  1027.  
  1028. -- Setup animation objects
  1029. function scriptChildModified(child)
  1030.     local fileList = animNames[child.Name]
  1031.     if (fileList ~= nil) then
  1032.         configureAnimationSet(child.Name, fileList)
  1033.     end
  1034. end
  1035.  
  1036. script.ChildAdded:connect(scriptChildModified)
  1037. script.ChildRemoved:connect(scriptChildModified)
  1038.  
  1039.  
  1040. for name, fileList in pairs(animNames) do
  1041.     configureAnimationSet(name, fileList)
  1042. end
  1043.  
  1044. -- ANIMATION
  1045.  
  1046. -- declarations
  1047. local toolAnim = "None"
  1048. local toolAnimTime = 0
  1049.  
  1050. local jumpAnimTime = 0
  1051. local jumpAnimDuration = 0.3
  1052.  
  1053. local toolTransitionTime = 0.1
  1054. local fallTransitionTime = 0.3
  1055. local jumpMaxLimbVelocity = 0.75
  1056.  
  1057. -- functions
  1058.  
  1059. function stopAllAnimations()
  1060.     local oldAnim = currentAnim
  1061.  
  1062.     -- return to idle if finishing an emote
  1063.     if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  1064.         oldAnim = "idle"
  1065.     end
  1066.  
  1067.     currentAnim = ""
  1068.     currentAnimInstance = nil
  1069.     if (currentAnimKeyframeHandler ~= nil) then
  1070.         currentAnimKeyframeHandler:disconnect()
  1071.     end
  1072.  
  1073.     if (currentAnimTrack ~= nil) then
  1074.         currentAnimTrack:Stop()
  1075.         currentAnimTrack:Destroy()
  1076.         currentAnimTrack = nil
  1077.     end
  1078.     return oldAnim
  1079. end
  1080.  
  1081. function setAnimationSpeed(speed)
  1082.     if speed ~= currentAnimSpeed then
  1083.         currentAnimSpeed = speed
  1084.         currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  1085.     end
  1086. end
  1087.  
  1088. function keyFrameReachedFunc(frameName)
  1089.     if (frameName == "End") then
  1090.  
  1091.         local repeatAnim = currentAnim
  1092.         -- return to idle if finishing an emote
  1093.         if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  1094.             repeatAnim = "idle"
  1095.         end
  1096.        
  1097.         local animSpeed = currentAnimSpeed
  1098.         playAnimation(repeatAnim, 0.0, Humanoid)
  1099.         setAnimationSpeed(animSpeed)
  1100.     end
  1101. end
  1102.  
  1103. -- Preload animations
  1104. function playAnimation(animName, transitionTime, humanoid)
  1105.        
  1106.     local roll = math.random(1, animTable[animName].totalWeight)
  1107.     local origRoll = roll
  1108.     local idx = 1
  1109.     while (roll > animTable[animName][idx].weight) do
  1110.         roll = roll - animTable[animName][idx].weight
  1111.         idx = idx + 1
  1112.     end
  1113. --      print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  1114.     local anim = animTable[animName][idx].anim
  1115.  
  1116.     -- switch animation    
  1117.     if (anim ~= currentAnimInstance) then
  1118.        
  1119.         if (currentAnimTrack ~= nil) then
  1120.             currentAnimTrack:Stop(transitionTime)
  1121.             currentAnimTrack:Destroy()
  1122.         end
  1123.  
  1124.         currentAnimSpeed = 1.0
  1125.    
  1126.         -- load it to the humanoid; get AnimationTrack
  1127.         currentAnimTrack = humanoid:LoadAnimation(anim)
  1128.         currentAnimTrack.Priority = Enum.AnimationPriority.Core
  1129.          
  1130.         -- play the animation
  1131.         currentAnimTrack:Play(transitionTime)
  1132.         currentAnim = animName
  1133.         currentAnimInstance = anim
  1134.  
  1135.         -- set up keyframe name triggers
  1136.         if (currentAnimKeyframeHandler ~= nil) then
  1137.             currentAnimKeyframeHandler:disconnect()
  1138.         end
  1139.         currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  1140.        
  1141.     end
  1142.  
  1143. end
  1144.  
  1145. -------------------------------------------------------------------------------------------
  1146. -------------------------------------------------------------------------------------------
  1147.  
  1148. local toolAnimName = ""
  1149. local toolAnimTrack = nil
  1150. local toolAnimInstance = nil
  1151. local currentToolAnimKeyframeHandler = nil
  1152.  
  1153. function toolKeyFrameReachedFunc(frameName)
  1154.     if (frameName == "End") then
  1155. --      print("Keyframe : ".. frameName)   
  1156.         playToolAnimation(toolAnimName, 0.0, Humanoid)
  1157.     end
  1158. end
  1159.  
  1160.  
  1161. function playToolAnimation(animName, transitionTime, humanoid, priority)     
  1162.        
  1163.         local roll = math.random(1, animTable[animName].totalWeight)
  1164.         local origRoll = roll
  1165.         local idx = 1
  1166.         while (roll > animTable[animName][idx].weight) do
  1167.             roll = roll - animTable[animName][idx].weight
  1168.             idx = idx + 1
  1169.         end
  1170. --      print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  1171.         local anim = animTable[animName][idx].anim
  1172.  
  1173.         if (toolAnimInstance ~= anim) then
  1174.            
  1175.             if (toolAnimTrack ~= nil) then
  1176.                 toolAnimTrack:Stop()
  1177.                 toolAnimTrack:Destroy()
  1178.                 transitionTime = 0
  1179.             end
  1180.                    
  1181.             -- load it to the humanoid; get AnimationTrack
  1182.             toolAnimTrack = humanoid:LoadAnimation(anim)
  1183.             if priority then
  1184.                 toolAnimTrack.Priority = priority
  1185.             end
  1186.              
  1187.             -- play the animation
  1188.             toolAnimTrack:Play(transitionTime)
  1189.             toolAnimName = animName
  1190.             toolAnimInstance = anim
  1191.  
  1192.             currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  1193.         end
  1194. end
  1195.  
  1196. function stopToolAnimations()
  1197.     local oldAnim = toolAnimName
  1198.  
  1199.     if (currentToolAnimKeyframeHandler ~= nil) then
  1200.         currentToolAnimKeyframeHandler:disconnect()
  1201.     end
  1202.  
  1203.     toolAnimName = ""
  1204.     toolAnimInstance = nil
  1205.     if (toolAnimTrack ~= nil) then
  1206.         toolAnimTrack:Stop()
  1207.         toolAnimTrack:Destroy()
  1208.         toolAnimTrack = nil
  1209.     end
  1210.  
  1211.  
  1212.     return oldAnim
  1213. end
  1214.  
  1215. -------------------------------------------------------------------------------------------
  1216. -------------------------------------------------------------------------------------------
  1217.  
  1218.  
  1219. function onRunning(speed)
  1220.     if speed > 0.01 then
  1221.         playAnimation("walk", 0.1, Humanoid)
  1222.         if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  1223.             setAnimationSpeed(speed / 14.5)
  1224.         end
  1225.         pose = "Running"
  1226.     else
  1227.         if emoteNames[currentAnim] == nil then
  1228.             playAnimation("idle", 0.1, Humanoid)
  1229.             pose = "Standing"
  1230.         end
  1231.     end
  1232. end
  1233.  
  1234. function onDied()
  1235.     pose = "Dead"
  1236. end
  1237.  
  1238. function onJumping()
  1239.     playAnimation("jump", 0.1, Humanoid)
  1240.     jumpAnimTime = jumpAnimDuration
  1241.     pose = "Jumping"
  1242. end
  1243.  
  1244. function onClimbing(speed)
  1245.     playAnimation("climb", 0.1, Humanoid)
  1246.     setAnimationSpeed(speed / 12.0)
  1247.     pose = "Climbing"
  1248. end
  1249.  
  1250. function onGettingUp()
  1251.     pose = "GettingUp"
  1252. end
  1253.  
  1254. function onFreeFall()
  1255.     if (jumpAnimTime <= 0) then
  1256.         playAnimation("fall", fallTransitionTime, Humanoid)
  1257.     end
  1258.     pose = "FreeFall"
  1259. end
  1260.  
  1261. function onFallingDown()
  1262.     pose = "FallingDown"
  1263. end
  1264.  
  1265. function onSeated()
  1266.     pose = "Seated"
  1267. end
  1268.  
  1269. function onPlatformStanding()
  1270.     pose = "PlatformStanding"
  1271. end
  1272.  
  1273. function onSwimming(speed)
  1274.     if speed > 0 then
  1275.         pose = "Running"
  1276.     else
  1277.         pose = "Standing"
  1278.     end
  1279. end
  1280.  
  1281. function getTool() 
  1282.     for _, kid in ipairs(Figure:GetChildren()) do
  1283.         if kid.className == "Tool" then return kid end
  1284.     end
  1285.     return nil
  1286. end
  1287.  
  1288. function getToolAnim(tool)
  1289.     for _, c in ipairs(tool:GetChildren()) do
  1290.         if c.Name == "toolanim" and c.className == "StringValue" then
  1291.             return c
  1292.         end
  1293.     end
  1294.     return nil
  1295. end
  1296.  
  1297. function animateTool()
  1298.    
  1299.     if (toolAnim == "None") then
  1300.         playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
  1301.         return
  1302.     end
  1303.  
  1304.     if (toolAnim == "Slash") then
  1305.         playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
  1306.         return
  1307.     end
  1308.  
  1309.     if (toolAnim == "Lunge") then
  1310.         playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
  1311.         return
  1312.     end
  1313. end
  1314.  
  1315. function moveSit()
  1316.     RightShoulder.MaxVelocity = 0.15
  1317.     LeftShoulder.MaxVelocity = 0.15
  1318.     RightShoulder:SetDesiredAngle(3.14 /2)
  1319.     LeftShoulder:SetDesiredAngle(-3.14 /2)
  1320.     RightHip:SetDesiredAngle(3.14 /2)
  1321.     LeftHip:SetDesiredAngle(-3.14 /2)
  1322. end
  1323.  
  1324. local lastTick = 0
  1325.  
  1326. function move(time)
  1327.     local amplitude = 1
  1328.     local frequency = 1
  1329.     local deltaTime = time - lastTick
  1330.     lastTick = time
  1331.  
  1332.     local climbFudge = 0
  1333.     local setAngles = false
  1334.  
  1335.     if (jumpAnimTime > 0) then
  1336.         jumpAnimTime = jumpAnimTime - deltaTime
  1337.     end
  1338.  
  1339.     if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1340.         playAnimation("fall", fallTransitionTime, Humanoid)
  1341.     elseif (pose == "Seated") then
  1342.         playAnimation("sit", 0.5, Humanoid)
  1343.         return
  1344.     elseif (pose == "Running") then
  1345.         playAnimation("walk", 0.1, Humanoid)
  1346.     elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1347. --      print("Wha " .. pose)
  1348.         stopAllAnimations()
  1349.         amplitude = 0.1
  1350.         frequency = 1
  1351.         setAngles = true
  1352.     end
  1353.  
  1354.     if (setAngles) then
  1355.         local desiredAngle = amplitude * math.sin(time * frequency)
  1356.  
  1357.         RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  1358.         LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  1359.         RightHip:SetDesiredAngle(-desiredAngle)
  1360.         LeftHip:SetDesiredAngle(-desiredAngle)
  1361.     end
  1362.  
  1363.     -- Tool Animation handling
  1364.     local tool = getTool()
  1365.     if tool and tool:FindFirstChild("Handle") then
  1366.    
  1367.         local animStringValueObject = getToolAnim(tool)
  1368.  
  1369.         if animStringValueObject then
  1370.             toolAnim = animStringValueObject.Value
  1371.             -- message recieved, delete StringValue
  1372.             animStringValueObject.Parent = nil
  1373.             toolAnimTime = time + .3
  1374.         end
  1375.  
  1376.         if time > toolAnimTime then
  1377.             toolAnimTime = 0
  1378.             toolAnim = "None"
  1379.         end
  1380.  
  1381.         animateTool()      
  1382.     else
  1383.         stopToolAnimations()
  1384.         toolAnim = "None"
  1385.         toolAnimInstance = nil
  1386.         toolAnimTime = 0
  1387.     end
  1388. end
  1389.  
  1390. -- connect events
  1391. Humanoid.Died:connect(onDied)
  1392. Humanoid.Running:connect(onRunning)
  1393. Humanoid.Jumping:connect(onJumping)
  1394. Humanoid.Climbing:connect(onClimbing)
  1395. Humanoid.GettingUp:connect(onGettingUp)
  1396. Humanoid.FreeFalling:connect(onFreeFall)
  1397. Humanoid.FallingDown:connect(onFallingDown)
  1398. Humanoid.Seated:connect(onSeated)
  1399. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1400. Humanoid.Swimming:connect(onSwimming)
  1401.  
  1402. -- setup emote chat hook
  1403. game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
  1404.     local emote = ""
  1405.     if msg == "/e dance" then
  1406.         emote = dances[math.random(1, #dances)]
  1407.     elseif (string.sub(msg, 1, 3) == "/e ") then
  1408.         emote = string.sub(msg, 4)
  1409.     elseif (string.sub(msg, 1, 7) == "/emote ") then
  1410.         emote = string.sub(msg, 8)
  1411.     end
  1412.    
  1413.     if (pose == "Standing" and emoteNames[emote] ~= nil) then
  1414.         playAnimation(emote, 0.1, Humanoid)
  1415.     end
  1416.  
  1417. end)
  1418.  
  1419.  
  1420. -- main program
  1421.  
  1422. -- initialize to idle
  1423. playAnimation("idle", 0.1, Humanoid)
  1424. pose = "Standing"
  1425.  
  1426. while Figure.Parent ~= nil do
  1427.     local _, time = wait(0.1)
  1428.     move(time)
  1429. end
  1430.  
  1431.  
  1432.  
  1433. end))
  1434. StringValue65.Name = "idle"
  1435. StringValue65.Parent = LocalScript64
  1436. Animation66.Name = "Animation1"
  1437. Animation66.Parent = StringValue65
  1438. Animation66.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  1439. NumberValue67.Name = "Weight"
  1440. NumberValue67.Parent = Animation66
  1441. NumberValue67.Value = 9
  1442. Animation68.Name = "Animation2"
  1443. Animation68.Parent = StringValue65
  1444. Animation68.AnimationId = "http://www.roblox.com/asset/?id=180435792"
  1445. NumberValue69.Name = "Weight"
  1446. NumberValue69.Parent = Animation68
  1447. NumberValue69.Value = 1
  1448. StringValue70.Name = "walk"
  1449. StringValue70.Parent = LocalScript64
  1450. Animation71.Name = "WalkAnim"
  1451. Animation71.Parent = StringValue70
  1452. Animation71.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1453. StringValue72.Name = "run"
  1454. StringValue72.Parent = LocalScript64
  1455. Animation73.Name = "RunAnim"
  1456. Animation73.Parent = StringValue72
  1457. Animation73.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1458. StringValue74.Name = "jump"
  1459. StringValue74.Parent = LocalScript64
  1460. Animation75.Name = "JumpAnim"
  1461. Animation75.Parent = StringValue74
  1462. Animation75.AnimationId = "http://www.roblox.com/asset/?id=125750702"
  1463. StringValue76.Name = "climb"
  1464. StringValue76.Parent = LocalScript64
  1465. Animation77.Name = "ClimbAnim"
  1466. Animation77.Parent = StringValue76
  1467. Animation77.AnimationId = "http://www.roblox.com/asset/?id=180436334"
  1468. StringValue78.Name = "toolnone"
  1469. StringValue78.Parent = LocalScript64
  1470. Animation79.Name = "ToolNoneAnim"
  1471. Animation79.Parent = StringValue78
  1472. Animation79.AnimationId = "http://www.roblox.com/asset/?id=182393478"
  1473. StringValue80.Name = "fall"
  1474. StringValue80.Parent = LocalScript64
  1475. Animation81.Name = "FallAnim"
  1476. Animation81.Parent = StringValue80
  1477. Animation81.AnimationId = "http://www.roblox.com/asset/?id=180436148"
  1478. StringValue82.Name = "sit"
  1479. StringValue82.Parent = LocalScript64
  1480. Animation83.Name = "SitAnim"
  1481. Animation83.Parent = StringValue82
  1482. Animation83.AnimationId = "http://www.roblox.com/asset/?id=178130996"
  1483. NumberValue84.Name = "ScaleDampeningPercent"
  1484. NumberValue84.Parent = LocalScript64
  1485. NumberValue84.Value = 0.4000000059604645
  1486. for i,v in pairs(mas:GetChildren()) do
  1487.     v.Parent = workspace
  1488.     pcall(function() v:MakeJoints() end)
  1489. end
  1490. mas:Destroy()
  1491. for i,v in pairs(cors) do
  1492.     spawn(function()
  1493.         pcall(v)
  1494.     end)
  1495. end
  1496.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement