Advertisement
firebudgy

ragdoll

May 20th, 2018
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 42.41 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. Attachment2 = Instance.new("Attachment")
  22. Attachment3 = Instance.new("Attachment")
  23. Attachment4 = Instance.new("Attachment")
  24. Attachment5 = Instance.new("Attachment")
  25. SpecialMesh6 = Instance.new("SpecialMesh")
  26. Decal7 = Instance.new("Decal")
  27. Part8 = Instance.new("Part")
  28. Decal9 = Instance.new("Decal")
  29. Attachment10 = Instance.new("Attachment")
  30. Attachment11 = Instance.new("Attachment")
  31. Attachment12 = Instance.new("Attachment")
  32. Attachment13 = Instance.new("Attachment")
  33. Attachment14 = Instance.new("Attachment")
  34. Attachment15 = Instance.new("Attachment")
  35. Attachment16 = Instance.new("Attachment")
  36. Attachment17 = Instance.new("Attachment")
  37. Weld18 = Instance.new("Weld")
  38. Weld19 = Instance.new("Weld")
  39. Part20 = Instance.new("Part")
  40. Attachment21 = Instance.new("Attachment")
  41. Attachment22 = Instance.new("Attachment")
  42. Weld23 = Instance.new("Weld")
  43. Part24 = Instance.new("Part")
  44. Attachment25 = Instance.new("Attachment")
  45. Attachment26 = Instance.new("Attachment")
  46. Weld27 = Instance.new("Weld")
  47. Part28 = Instance.new("Part")
  48. Attachment29 = Instance.new("Attachment")
  49. Weld30 = Instance.new("Weld")
  50. Part31 = Instance.new("Part")
  51. Attachment32 = Instance.new("Attachment")
  52. Weld33 = Instance.new("Weld")
  53. Humanoid34 = Instance.new("Humanoid")
  54. Part35 = Instance.new("Part")
  55. Attachment36 = Instance.new("Attachment")
  56. Shirt37 = Instance.new("Shirt")
  57. LocalScript38 = Instance.new("LocalScript")
  58. StringValue39 = Instance.new("StringValue")
  59. Animation40 = Instance.new("Animation")
  60. NumberValue41 = Instance.new("NumberValue")
  61. Animation42 = Instance.new("Animation")
  62. NumberValue43 = Instance.new("NumberValue")
  63. StringValue44 = Instance.new("StringValue")
  64. Animation45 = Instance.new("Animation")
  65. StringValue46 = Instance.new("StringValue")
  66. Animation47 = Instance.new("Animation")
  67. StringValue48 = Instance.new("StringValue")
  68. Animation49 = Instance.new("Animation")
  69. StringValue50 = Instance.new("StringValue")
  70. Animation51 = Instance.new("Animation")
  71. StringValue52 = Instance.new("StringValue")
  72. Animation53 = Instance.new("Animation")
  73. StringValue54 = Instance.new("StringValue")
  74. Animation55 = Instance.new("Animation")
  75. StringValue56 = Instance.new("StringValue")
  76. Animation57 = Instance.new("Animation")
  77. CharacterMesh58 = Instance.new("CharacterMesh")
  78. BodyColors59 = Instance.new("BodyColors")
  79. CharacterMesh60 = Instance.new("CharacterMesh")
  80. Accessory61 = Instance.new("Accessory")
  81. Part62 = Instance.new("Part")
  82. SpecialMesh63 = Instance.new("SpecialMesh")
  83. Attachment64 = Instance.new("Attachment")
  84. Vector3Value65 = Instance.new("Vector3Value")
  85. Pants66 = Instance.new("Pants")
  86. CharacterMesh67 = Instance.new("CharacterMesh")
  87. CharacterMesh68 = Instance.new("CharacterMesh")
  88. CharacterMesh69 = Instance.new("CharacterMesh")
  89. Part70 = Instance.new("Part")
  90. Part71 = Instance.new("Part")
  91. Part72 = Instance.new("Part")
  92. Part73 = Instance.new("Part")
  93. Part74 = Instance.new("Part")
  94. Script75 = Instance.new("Script")
  95. LocalScript76 = Instance.new("LocalScript")
  96. ObjectValue77 = Instance.new("ObjectValue")
  97. Model0.Name = " "
  98. Model0.Parent = mas
  99. Model0.PrimaryPart = Part1
  100. Part1.Name = "Head"
  101. Part1.Parent = Model0
  102. Part1.BrickColor = BrickColor.new("White")
  103. Part1.Rotation = Vector3.new(-92.659996, -88.9000015, -92.6800003)
  104. Part1.FormFactor = Enum.FormFactor.Symmetric
  105. Part1.Size = Vector3.new(2, 1, 1)
  106. Part1.CFrame = CFrame.new(-32.7889519, 4.50256634, -62.3428764, -0.000896211946, 0.0191786997, -0.999815643, -0.000249215751, 0.99981606, 0.0191789325, 0.999999642, 0.000266358227, -0.000891267613)
  107. Part1.TopSurface = Enum.SurfaceType.Smooth
  108. Part1.Color = Color3.new(0.94902, 0.952941, 0.952941)
  109. Part1.Position = Vector3.new(-32.7889519, 4.50256634, -62.3428764)
  110. Part1.Orientation = Vector3.new(-1.10000002, -90.0499954, -0.00999999978)
  111. Part1.Color = Color3.new(0.94902, 0.952941, 0.952941)
  112. Attachment2.Name = "HairAttachment"
  113. Attachment2.Parent = Part1
  114. Attachment2.CFrame = CFrame.new(0, 0.600000024, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  115. Attachment2.Position = Vector3.new(0, 0.600000024, 0)
  116. Attachment3.Name = "HatAttachment"
  117. Attachment3.Parent = Part1
  118. Attachment3.CFrame = CFrame.new(0, 0.600000024, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  119. Attachment3.Position = Vector3.new(0, 0.600000024, 0)
  120. Attachment4.Name = "FaceFrontAttachment"
  121. Attachment4.Parent = Part1
  122. Attachment4.CFrame = CFrame.new(0, 0, -0.600000024, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  123. Attachment4.Position = Vector3.new(0, 0, -0.600000024)
  124. Attachment5.Name = "FaceCenterAttachment"
  125. Attachment5.Parent = Part1
  126. SpecialMesh6.Parent = Part1
  127. SpecialMesh6.MeshId = "http://www.roblox.com/asset/?id=83001675"
  128. SpecialMesh6.Scale = Vector3.new(1.25, 1.25, 1.25)
  129. SpecialMesh6.MeshType = Enum.MeshType.FileMesh
  130. SpecialMesh6.Scale = Vector3.new(1.25, 1.25, 1.25)
  131. Decal7.Name = "face"
  132. Decal7.Parent = Part1
  133. Decal7.Texture = "http://www.roblox.com/asset/?id=144080495 "
  134. Part8.Name = "Torso"
  135. Part8.Parent = Model0
  136. Part8.BrickColor = BrickColor.new("Light stone grey")
  137. Part8.Rotation = Vector3.new(-92.659996, -88.9000015, -92.6800003)
  138. Part8.FormFactor = Enum.FormFactor.Symmetric
  139. Part8.Size = Vector3.new(2, 2, 1)
  140. Part8.CFrame = CFrame.new(-32.8177185, 3.00284195, -62.343277, -0.000896211946, 0.0191786997, -0.999815643, -0.000249215751, 0.99981606, 0.0191789325, 0.999999642, 0.000266358227, -0.000891267613)
  141. Part8.LeftSurface = Enum.SurfaceType.Weld
  142. Part8.RightSurface = Enum.SurfaceType.Weld
  143. Part8.Color = Color3.new(0.898039, 0.894118, 0.87451)
  144. Part8.Position = Vector3.new(-32.8177185, 3.00284195, -62.343277)
  145. Part8.Orientation = Vector3.new(-1.10000002, -90.0499954, -0.00999999978)
  146. Part8.Color = Color3.new(0.898039, 0.894118, 0.87451)
  147. Decal9.Name = "roblox"
  148. Decal9.Parent = Part8
  149. Attachment10.Name = "NeckAttachment"
  150. Attachment10.Parent = Part8
  151. Attachment10.CFrame = CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  152. Attachment10.Position = Vector3.new(0, 1, 0)
  153. Attachment11.Name = "BodyFrontAttachment"
  154. Attachment11.Parent = Part8
  155. Attachment11.CFrame = CFrame.new(0, 0, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  156. Attachment11.Position = Vector3.new(0, 0, -0.5)
  157. Attachment12.Name = "BodyBackAttachment"
  158. Attachment12.Parent = Part8
  159. Attachment12.CFrame = CFrame.new(0, 0, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  160. Attachment12.Position = Vector3.new(0, 0, 0.5)
  161. Attachment13.Name = "LeftCollarAttachment"
  162. Attachment13.Parent = Part8
  163. Attachment13.CFrame = CFrame.new(-1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  164. Attachment13.Position = Vector3.new(-1, 1, 0)
  165. Attachment14.Name = "RightCollarAttachment"
  166. Attachment14.Parent = Part8
  167. Attachment14.CFrame = CFrame.new(1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  168. Attachment14.Position = Vector3.new(1, 1, 0)
  169. Attachment15.Name = "WaistFrontAttachment"
  170. Attachment15.Parent = Part8
  171. Attachment15.CFrame = CFrame.new(0, -1, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  172. Attachment15.Position = Vector3.new(0, -1, -0.5)
  173. Attachment16.Name = "WaistCenterAttachment"
  174. Attachment16.Parent = Part8
  175. Attachment16.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  176. Attachment16.Position = Vector3.new(0, -1, 0)
  177. Attachment17.Name = "WaistBackAttachment"
  178. Attachment17.Parent = Part8
  179. Attachment17.CFrame = CFrame.new(0, -1, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  180. Attachment17.Position = Vector3.new(0, -1, 0.5)
  181. Weld18.Name = "Neck"
  182. Weld18.Parent = Part8
  183. Weld18.C0 = CFrame.new(0, 1.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  184. Weld18.Part0 = Part8
  185. Weld18.Part1 = Part1
  186. Weld19.Parent = Part8
  187. Weld19.C0 = CFrame.new(0, 0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  188. Weld19.Part0 = Part8
  189. Weld19.Part1 = Part74
  190. Part20.Name = "Left Arm"
  191. Part20.Parent = Model0
  192. Part20.BrickColor = BrickColor.new("White")
  193. Part20.Rotation = Vector3.new(-88.8799973, -89.7599945, -88.8899994)
  194. Part20.CanCollide = false
  195. Part20.FormFactor = Enum.FormFactor.Symmetric
  196. Part20.Size = Vector3.new(1, 2, 1)
  197. Part20.CFrame = CFrame.new(-32.8089905, 3.00308895, -63.8432312, 8.19999914e-05, 0.00424200017, -0.999991, -0.000180000003, 0.999991, 0.00424198527, 1, 0.000179650538, 8.27628319e-05)
  198. Part20.Color = Color3.new(0.94902, 0.952941, 0.952941)
  199. Part20.Position = Vector3.new(-32.8089905, 3.00308895, -63.8432312)
  200. Part20.Orientation = Vector3.new(-0.239999995, -90, -0.00999999978)
  201. Part20.Color = Color3.new(0.94902, 0.952941, 0.952941)
  202. Attachment21.Name = "LeftShoulderAttachment"
  203. Attachment21.Parent = Part20
  204. Attachment21.CFrame = CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  205. Attachment21.Position = Vector3.new(0, 1, 0)
  206. Attachment22.Name = "LeftGripAttachment"
  207. Attachment22.Parent = Part20
  208. Attachment22.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  209. Attachment22.Position = Vector3.new(0, -1, 0)
  210. Weld23.Parent = Part20
  211. Weld23.C0 = CFrame.new(0, -0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  212. Weld23.Part0 = Part20
  213. Weld23.Part1 = Part71
  214. Part24.Name = "Right Arm"
  215. Part24.Parent = Model0
  216. Part24.BrickColor = BrickColor.new("White")
  217. Part24.Rotation = Vector3.new(57.6599998, -89.9799957, 57.6499977)
  218. Part24.CanCollide = false
  219. Part24.FormFactor = Enum.FormFactor.Symmetric
  220. Part24.Size = Vector3.new(1, 2, 1)
  221. Part24.CFrame = CFrame.new(-32.8094177, 3.00234795, -60.8432312, 0.000162442448, -0.000256485306, -0.99999994, -0.000184689823, 1, -0.000256515108, 1, 0.0001847315, 0.00016239511)
  222. Part24.Color = Color3.new(0.94902, 0.952941, 0.952941)
  223. Part24.Position = Vector3.new(-32.8094177, 3.00234795, -60.8432312)
  224. Part24.Orientation = Vector3.new(0.00999999978, -89.9899979, -0.00999999978)
  225. Part24.Color = Color3.new(0.94902, 0.952941, 0.952941)
  226. Attachment25.Name = "RightShoulderAttachment"
  227. Attachment25.Parent = Part24
  228. Attachment25.CFrame = CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  229. Attachment25.Position = Vector3.new(0, 1, 0)
  230. Attachment26.Name = "RightGripAttachment"
  231. Attachment26.Parent = Part24
  232. Attachment26.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  233. Attachment26.Position = Vector3.new(0, -1, 0)
  234. Weld27.Parent = Part24
  235. Weld27.C0 = CFrame.new(0, -0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  236. Weld27.Part0 = Part24
  237. Weld27.Part1 = Part70
  238. Part28.Name = "Left Leg"
  239. Part28.Parent = Model0
  240. Part28.BrickColor = BrickColor.new("Medium blue")
  241. Part28.Rotation = Vector3.new(79.3600006, -89.6399994, 79.3600006)
  242. Part28.CanCollide = false
  243. Part28.FormFactor = Enum.FormFactor.Symmetric
  244. Part28.Size = Vector3.new(1, 2, 1)
  245. Part28.CFrame = CFrame.new(-32.8302917, 1.003093, -62.8435822, 0.00115803222, -0.00616325252, -0.99998033, -2.37580807e-05, 0.999980986, -0.00616328325, 0.999999404, 3.08949129e-05, 0.00115786388)
  246. Part28.BottomSurface = Enum.SurfaceType.Smooth
  247. Part28.Color = Color3.new(0.431373, 0.6, 0.792157)
  248. Part28.Position = Vector3.new(-32.8302917, 1.003093, -62.8435822)
  249. Part28.Orientation = Vector3.new(0.349999994, -89.9300003, 0)
  250. Part28.Color = Color3.new(0.431373, 0.6, 0.792157)
  251. Attachment29.Name = "LeftFootAttachment"
  252. Attachment29.Parent = Part28
  253. Attachment29.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  254. Attachment29.Position = Vector3.new(0, -1, 0)
  255. Weld30.Parent = Part28
  256. Weld30.C0 = CFrame.new(0, -0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  257. Weld30.Part0 = Part28
  258. Weld30.Part1 = Part73
  259. Part31.Name = "Right Leg"
  260. Part31.Parent = Model0
  261. Part31.BrickColor = BrickColor.new("Medium blue")
  262. Part31.Rotation = Vector3.new(-99.75, -89.7399979, -99.6999969)
  263. Part31.CanCollide = false
  264. Part31.FormFactor = Enum.FormFactor.Symmetric
  265. Part31.Size = Vector3.new(1, 2, 1)
  266. Part31.CFrame = CFrame.new(-32.8418884, 1.002846, -61.8426437, -0.000776336063, 0.00454139849, -0.99998939, 0.000924410648, 0.999989271, 0.00454068044, 0.999999285, -0.000920875755, -0.00078052585)
  267. Part31.BottomSurface = Enum.SurfaceType.Smooth
  268. Part31.Color = Color3.new(0.431373, 0.6, 0.792157)
  269. Part31.Position = Vector3.new(-32.8418884, 1.002846, -61.8426437)
  270. Part31.Orientation = Vector3.new(-0.25999999, -90.0400009, 0.049999997)
  271. Part31.Color = Color3.new(0.431373, 0.6, 0.792157)
  272. Attachment32.Name = "RightFootAttachment"
  273. Attachment32.Parent = Part31
  274. Attachment32.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  275. Attachment32.Position = Vector3.new(0, -1, 0)
  276. Weld33.Parent = Part31
  277. Weld33.C0 = CFrame.new(0, -0.5, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  278. Weld33.Part0 = Part31
  279. Weld33.Part1 = Part72
  280. Humanoid34.Name = "Humanoid2"
  281. Humanoid34.Parent = Model0
  282. Humanoid34.RightLeg = Part31
  283. Humanoid34.LeftLeg = Part28
  284. Humanoid34.Torso = Part35
  285. Humanoid34.Health = 0
  286. Humanoid34.MaxHealth = 0
  287. Part35.Name = "HumanoidRootPart"
  288. Part35.Parent = Model0
  289. Part35.Transparency = 1
  290. Part35.Rotation = Vector3.new(-1.36000001, -89.9499969, -1.33999991)
  291. Part35.RotVelocity = Vector3.new(4.23053552e-06, 1.68939623e-05, -1.860458e-05)
  292. Part35.Velocity = Vector3.new(5.48453863e-06, -0.000462770462, 4.08444612e-06)
  293. Part35.FormFactor = Enum.FormFactor.Symmetric
  294. Part35.Size = Vector3.new(2, 2, 1)
  295. Part35.CFrame = CFrame.new(-31.8220825, 1.00064802, -62.3431854, 0.000939510879, 2.20215879e-05, -0.999999583, 0.000282525667, 0.99999994, 2.22870149e-05, 0.999999523, -0.000282546447, 0.000939504534)
  296. Part35.BottomSurface = Enum.SurfaceType.Smooth
  297. Part35.TopSurface = Enum.SurfaceType.Smooth
  298. Part35.Position = Vector3.new(-31.8220825, 1.00064802, -62.3431854)
  299. Part35.Orientation = Vector3.new(0, -89.9499969, 0.0199999996)
  300. Attachment36.Name = "RootAttachment"
  301. Attachment36.Parent = Part35
  302. Shirt37.Name = "Shirt"
  303. Shirt37.Parent = Model0
  304. Shirt37.ShirtTemplate = "http://www.roblox.com/asset/?id=144076357"
  305. LocalScript38.Name = "Animate"
  306. LocalScript38.Parent = Model0
  307. table.insert(cors,sandbox(LocalScript38,function()
  308. local Figure = script.Parent
  309. local Torso = Figure:WaitForChild("Torso")
  310. local RightShoulder = Torso:WaitForChild("Right Shoulder")
  311. local LeftShoulder = Torso:WaitForChild("Left Shoulder")
  312. local RightHip = Torso:WaitForChild("Right Hip")
  313. local LeftHip = Torso:WaitForChild("Left Hip")
  314. local Neck = Torso:WaitForChild("Neck")
  315. local Humanoid = Figure:WaitForChild("Humanoid")
  316. local pose = "Standing"
  317.  
  318. local currentAnim = ""
  319. local currentAnimInstance = nil
  320. local currentAnimTrack = nil
  321. local currentAnimKeyframeHandler = nil
  322. local currentAnimSpeed = 1.0
  323. local animTable = {}
  324. local animNames = {
  325. idle = {
  326. { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  327. { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  328. },
  329. walk = {
  330. { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  331. },
  332. run = {
  333. { id = "run.xml", weight = 10 }
  334. },
  335. jump = {
  336. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  337. },
  338. fall = {
  339. { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  340. },
  341. climb = {
  342. { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  343. },
  344. sit = {
  345. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  346. },
  347. toolnone = {
  348. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  349. },
  350. toolslash = {
  351. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  352. -- { id = "slash.xml", weight = 10 }
  353. },
  354. toollunge = {
  355. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  356. },
  357. wave = {
  358. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  359. },
  360. point = {
  361. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  362. },
  363. dance1 = {
  364. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  365. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  366. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  367. },
  368. dance2 = {
  369. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  370. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  371. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  372. },
  373. dance3 = {
  374. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  375. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  376. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  377. },
  378. laugh = {
  379. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  380. },
  381. cheer = {
  382. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  383. },
  384. }
  385. local dances = {"dance1", "dance2", "dance3"}
  386.  
  387. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  388. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  389.  
  390. function configureAnimationSet(name, fileList)
  391. if (animTable[name] ~= nil) then
  392. for _, connection in pairs(animTable[name].connections) do
  393. connection:disconnect()
  394. end
  395. end
  396. animTable[name] = {}
  397. animTable[name].count = 0
  398. animTable[name].totalWeight = 0
  399. animTable[name].connections = {}
  400.  
  401. -- check for config values
  402. local config = script:FindFirstChild(name)
  403. if (config ~= nil) then
  404. -- print("Loading anims " .. name)
  405. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  406. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  407. local idx = 1
  408. for _, childPart in pairs(config:GetChildren()) do
  409. if (childPart:IsA("Animation")) then
  410. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  411. animTable[name][idx] = {}
  412. animTable[name][idx].anim = childPart
  413. local weightObject = childPart:FindFirstChild("Weight")
  414. if (weightObject == nil) then
  415. animTable[name][idx].weight = 1
  416. else
  417. animTable[name][idx].weight = weightObject.Value
  418. end
  419. animTable[name].count = animTable[name].count + 1
  420. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  421. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  422. idx = idx + 1
  423. end
  424. end
  425. end
  426.  
  427. -- fallback to defaults
  428. if (animTable[name].count <= 0) then
  429. for idx, anim in pairs(fileList) do
  430. animTable[name][idx] = {}
  431. animTable[name][idx].anim = Instance.new("Animation")
  432. animTable[name][idx].anim.Name = name
  433. animTable[name][idx].anim.AnimationId = anim.id
  434. animTable[name][idx].weight = anim.weight
  435. animTable[name].count = animTable[name].count + 1
  436. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  437. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  438. end
  439. end
  440. end
  441.  
  442. -- Setup animation objects
  443. function scriptChildModified(child)
  444. local fileList = animNames[child.Name]
  445. if (fileList ~= nil) then
  446. configureAnimationSet(child.Name, fileList)
  447. end
  448. end
  449.  
  450. script.ChildAdded:connect(scriptChildModified)
  451. script.ChildRemoved:connect(scriptChildModified)
  452.  
  453.  
  454. for name, fileList in pairs(animNames) do
  455. configureAnimationSet(name, fileList)
  456. end
  457.  
  458. -- ANIMATION
  459.  
  460. -- declarations
  461. local toolAnim = "None"
  462. local toolAnimTime = 0
  463.  
  464. local jumpAnimTime = 0
  465. local jumpAnimDuration = 0.3
  466.  
  467. local toolTransitionTime = 0.1
  468. local fallTransitionTime = 0.3
  469. local jumpMaxLimbVelocity = 0.75
  470.  
  471. -- functions
  472.  
  473. function stopAllAnimations()
  474. local oldAnim = currentAnim
  475.  
  476. -- return to idle if finishing an emote
  477. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  478. oldAnim = "idle"
  479. end
  480.  
  481. currentAnim = ""
  482. currentAnimInstance = nil
  483. if (currentAnimKeyframeHandler ~= nil) then
  484. currentAnimKeyframeHandler:disconnect()
  485. end
  486.  
  487. if (currentAnimTrack ~= nil) then
  488. currentAnimTrack:Stop()
  489. currentAnimTrack:Destroy()
  490. currentAnimTrack = nil
  491. end
  492. return oldAnim
  493. end
  494.  
  495. function setAnimationSpeed(speed)
  496. if speed ~= currentAnimSpeed then
  497. currentAnimSpeed = speed
  498. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  499. end
  500. end
  501.  
  502. function keyFrameReachedFunc(frameName)
  503. if (frameName == "End") then
  504.  
  505. local repeatAnim = currentAnim
  506. -- return to idle if finishing an emote
  507. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  508. repeatAnim = "idle"
  509. end
  510.  
  511. local animSpeed = currentAnimSpeed
  512. playAnimation(repeatAnim, 0.0, Humanoid)
  513. setAnimationSpeed(animSpeed)
  514. end
  515. end
  516.  
  517. -- Preload animations
  518. function playAnimation(animName, transitionTime, humanoid)
  519.  
  520. local roll = math.random(1, animTable[animName].totalWeight)
  521. local origRoll = roll
  522. local idx = 1
  523. while (roll > animTable[animName][idx].weight) do
  524. roll = roll - animTable[animName][idx].weight
  525. idx = idx + 1
  526. end
  527. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  528. local anim = animTable[animName][idx].anim
  529.  
  530. -- switch animation
  531. if (anim ~= currentAnimInstance) then
  532.  
  533. if (currentAnimTrack ~= nil) then
  534. currentAnimTrack:Stop(transitionTime)
  535. currentAnimTrack:Destroy()
  536. end
  537.  
  538. currentAnimSpeed = 1.0
  539.  
  540. -- load it to the humanoid; get AnimationTrack
  541. currentAnimTrack = humanoid:LoadAnimation(anim)
  542. currentAnimTrack.Priority = Enum.AnimationPriority.Core
  543.  
  544. -- play the animation
  545. currentAnimTrack:Play(transitionTime)
  546. currentAnim = animName
  547. currentAnimInstance = anim
  548.  
  549. -- set up keyframe name triggers
  550. if (currentAnimKeyframeHandler ~= nil) then
  551. currentAnimKeyframeHandler:disconnect()
  552. end
  553. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  554.  
  555. end
  556.  
  557. end
  558.  
  559. -------------------------------------------------------------------------------------------
  560. -------------------------------------------------------------------------------------------
  561.  
  562. local toolAnimName = ""
  563. local toolAnimTrack = nil
  564. local toolAnimInstance = nil
  565. local currentToolAnimKeyframeHandler = nil
  566.  
  567. function toolKeyFrameReachedFunc(frameName)
  568. if (frameName == "End") then
  569. -- print("Keyframe : ".. frameName)
  570. playToolAnimation(toolAnimName, 0.0, Humanoid)
  571. end
  572. end
  573.  
  574.  
  575. function playToolAnimation(animName, transitionTime, humanoid, priority)
  576.  
  577. local roll = math.random(1, animTable[animName].totalWeight)
  578. local origRoll = roll
  579. local idx = 1
  580. while (roll > animTable[animName][idx].weight) do
  581. roll = roll - animTable[animName][idx].weight
  582. idx = idx + 1
  583. end
  584. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  585. local anim = animTable[animName][idx].anim
  586.  
  587. if (toolAnimInstance ~= anim) then
  588.  
  589. if (toolAnimTrack ~= nil) then
  590. toolAnimTrack:Stop()
  591. toolAnimTrack:Destroy()
  592. transitionTime = 0
  593. end
  594.  
  595. -- load it to the humanoid; get AnimationTrack
  596. toolAnimTrack = humanoid:LoadAnimation(anim)
  597. if priority then
  598. toolAnimTrack.Priority = priority
  599. end
  600.  
  601. -- play the animation
  602. toolAnimTrack:Play(transitionTime)
  603. toolAnimName = animName
  604. toolAnimInstance = anim
  605.  
  606. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  607. end
  608. end
  609.  
  610. function stopToolAnimations()
  611. local oldAnim = toolAnimName
  612.  
  613. if (currentToolAnimKeyframeHandler ~= nil) then
  614. currentToolAnimKeyframeHandler:disconnect()
  615. end
  616.  
  617. toolAnimName = ""
  618. toolAnimInstance = nil
  619. if (toolAnimTrack ~= nil) then
  620. toolAnimTrack:Stop()
  621. toolAnimTrack:Destroy()
  622. toolAnimTrack = nil
  623. end
  624.  
  625.  
  626. return oldAnim
  627. end
  628.  
  629. -------------------------------------------------------------------------------------------
  630. -------------------------------------------------------------------------------------------
  631.  
  632.  
  633. function onRunning(speed)
  634. if speed > 0.01 then
  635. playAnimation("walk", 0.1, Humanoid)
  636. if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  637. setAnimationSpeed(speed / 14.5)
  638. end
  639. pose = "Running"
  640. else
  641. if emoteNames[currentAnim] == nil then
  642. playAnimation("idle", 0.1, Humanoid)
  643. pose = "Standing"
  644. end
  645. end
  646. end
  647.  
  648. function onDied()
  649. pose = "Dead"
  650. end
  651.  
  652. function onJumping()
  653. playAnimation("jump", 0.1, Humanoid)
  654. jumpAnimTime = jumpAnimDuration
  655. pose = "Jumping"
  656. end
  657.  
  658. function onClimbing(speed)
  659. playAnimation("climb", 0.1, Humanoid)
  660. setAnimationSpeed(speed / 12.0)
  661. pose = "Climbing"
  662. end
  663.  
  664. function onGettingUp()
  665. pose = "GettingUp"
  666. end
  667.  
  668. function onFreeFall()
  669. if (jumpAnimTime <= 0) then
  670. playAnimation("fall", fallTransitionTime, Humanoid)
  671. end
  672. pose = "FreeFall"
  673. end
  674.  
  675. function onFallingDown()
  676. pose = "FallingDown"
  677. end
  678.  
  679. function onSeated()
  680. pose = "Seated"
  681. end
  682.  
  683. function onPlatformStanding()
  684. pose = "PlatformStanding"
  685. end
  686.  
  687. function onSwimming(speed)
  688. if speed > 0 then
  689. pose = "Running"
  690. else
  691. pose = "Standing"
  692. end
  693. end
  694.  
  695. function getTool()
  696. for _, kid in ipairs(Figure:GetChildren()) do
  697. if kid.className == "Tool" then return kid end
  698. end
  699. return nil
  700. end
  701.  
  702. function getToolAnim(tool)
  703. for _, c in ipairs(tool:GetChildren()) do
  704. if c.Name == "toolanim" and c.className == "StringValue" then
  705. return c
  706. end
  707. end
  708. return nil
  709. end
  710.  
  711. function animateTool()
  712.  
  713. if (toolAnim == "None") then
  714. playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
  715. return
  716. end
  717.  
  718. if (toolAnim == "Slash") then
  719. playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
  720. return
  721. end
  722.  
  723. if (toolAnim == "Lunge") then
  724. playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
  725. return
  726. end
  727. end
  728.  
  729. function moveSit()
  730. RightShoulder.MaxVelocity = 0.15
  731. LeftShoulder.MaxVelocity = 0.15
  732. RightShoulder:SetDesiredAngle(3.14 /2)
  733. LeftShoulder:SetDesiredAngle(-3.14 /2)
  734. RightHip:SetDesiredAngle(3.14 /2)
  735. LeftHip:SetDesiredAngle(-3.14 /2)
  736. end
  737.  
  738. local lastTick = 0
  739.  
  740. function move(time)
  741. local amplitude = 1
  742. local frequency = 1
  743. local deltaTime = time - lastTick
  744. lastTick = time
  745.  
  746. local climbFudge = 0
  747. local setAngles = false
  748.  
  749. if (jumpAnimTime > 0) then
  750. jumpAnimTime = jumpAnimTime - deltaTime
  751. end
  752.  
  753. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  754. playAnimation("fall", fallTransitionTime, Humanoid)
  755. elseif (pose == "Seated") then
  756. playAnimation("sit", 0.5, Humanoid)
  757. return
  758. elseif (pose == "Running") then
  759. playAnimation("walk", 0.1, Humanoid)
  760. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  761. -- print("Wha " .. pose)
  762. stopAllAnimations()
  763. amplitude = 0.1
  764. frequency = 1
  765. setAngles = true
  766. end
  767.  
  768. if (setAngles) then
  769. local desiredAngle = amplitude * math.sin(time * frequency)
  770.  
  771. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  772. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  773. RightHip:SetDesiredAngle(-desiredAngle)
  774. LeftHip:SetDesiredAngle(-desiredAngle)
  775. end
  776.  
  777. -- Tool Animation handling
  778. local tool = getTool()
  779. if tool and tool:FindFirstChild("Handle") then
  780.  
  781. local animStringValueObject = getToolAnim(tool)
  782.  
  783. if animStringValueObject then
  784. toolAnim = animStringValueObject.Value
  785. -- message recieved, delete StringValue
  786. animStringValueObject.Parent = nil
  787. toolAnimTime = time + .3
  788. end
  789.  
  790. if time > toolAnimTime then
  791. toolAnimTime = 0
  792. toolAnim = "None"
  793. end
  794.  
  795. animateTool()
  796. else
  797. stopToolAnimations()
  798. toolAnim = "None"
  799. toolAnimInstance = nil
  800. toolAnimTime = 0
  801. end
  802. end
  803.  
  804. -- connect events
  805. Humanoid.Died:connect(onDied)
  806. Humanoid.Running:connect(onRunning)
  807. Humanoid.Jumping:connect(onJumping)
  808. Humanoid.Climbing:connect(onClimbing)
  809. Humanoid.GettingUp:connect(onGettingUp)
  810. Humanoid.FreeFalling:connect(onFreeFall)
  811. Humanoid.FallingDown:connect(onFallingDown)
  812. Humanoid.Seated:connect(onSeated)
  813. Humanoid.PlatformStanding:connect(onPlatformStanding)
  814. Humanoid.Swimming:connect(onSwimming)
  815.  
  816. -- setup emote chat hook
  817. game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
  818. local emote = ""
  819. if msg == "/e dance" then
  820. emote = dances[math.random(1, #dances)]
  821. elseif (string.sub(msg, 1, 3) == "/e ") then
  822. emote = string.sub(msg, 4)
  823. elseif (string.sub(msg, 1, 7) == "/emote ") then
  824. emote = string.sub(msg, 8)
  825. end
  826.  
  827. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  828. playAnimation(emote, 0.1, Humanoid)
  829. end
  830.  
  831. end)
  832.  
  833.  
  834. -- main program
  835.  
  836. -- initialize to idle
  837. playAnimation("idle", 0.1, Humanoid)
  838. pose = "Standing"
  839.  
  840. while Figure.Parent ~= nil do
  841. local _, time = wait(0.1)
  842. move(time)
  843. end
  844.  
  845.  
  846.  
  847. end))
  848. StringValue39.Name = "idle"
  849. StringValue39.Parent = LocalScript38
  850. Animation40.Name = "Animation1"
  851. Animation40.Parent = StringValue39
  852. Animation40.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  853. NumberValue41.Name = "Weight"
  854. NumberValue41.Parent = Animation40
  855. NumberValue41.Value = 9
  856. Animation42.Name = "Animation2"
  857. Animation42.Parent = StringValue39
  858. Animation42.AnimationId = "http://www.roblox.com/asset/?id=180435792"
  859. NumberValue43.Name = "Weight"
  860. NumberValue43.Parent = Animation42
  861. NumberValue43.Value = 1
  862. StringValue44.Name = "walk"
  863. StringValue44.Parent = LocalScript38
  864. Animation45.Name = "WalkAnim"
  865. Animation45.Parent = StringValue44
  866. Animation45.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  867. StringValue46.Name = "run"
  868. StringValue46.Parent = LocalScript38
  869. Animation47.Name = "RunAnim"
  870. Animation47.Parent = StringValue46
  871. Animation47.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  872. StringValue48.Name = "jump"
  873. StringValue48.Parent = LocalScript38
  874. Animation49.Name = "JumpAnim"
  875. Animation49.Parent = StringValue48
  876. Animation49.AnimationId = "http://www.roblox.com/asset/?id=125750702"
  877. StringValue50.Name = "climb"
  878. StringValue50.Parent = LocalScript38
  879. Animation51.Name = "ClimbAnim"
  880. Animation51.Parent = StringValue50
  881. Animation51.AnimationId = "http://www.roblox.com/asset/?id=180436334"
  882. StringValue52.Name = "toolnone"
  883. StringValue52.Parent = LocalScript38
  884. Animation53.Name = "ToolNoneAnim"
  885. Animation53.Parent = StringValue52
  886. Animation53.AnimationId = "http://www.roblox.com/asset/?id=182393478"
  887. StringValue54.Name = "fall"
  888. StringValue54.Parent = LocalScript38
  889. Animation55.Name = "FallAnim"
  890. Animation55.Parent = StringValue54
  891. Animation55.AnimationId = "http://www.roblox.com/asset/?id=180436148"
  892. StringValue56.Name = "sit"
  893. StringValue56.Parent = LocalScript38
  894. Animation57.Name = "SitAnim"
  895. Animation57.Parent = StringValue56
  896. Animation57.AnimationId = "http://www.roblox.com/asset/?id=178130996"
  897. CharacterMesh58.Parent = Model0
  898. CharacterMesh58.MeshId = 81487640
  899. CharacterMesh58.BodyPart = Enum.BodyPart.LeftLeg
  900. BodyColors59.Parent = Model0
  901. BodyColors59.HeadColor = BrickColor.new("White")
  902. BodyColors59.LeftArmColor = BrickColor.new("White")
  903. BodyColors59.LeftLegColor = BrickColor.new("Medium blue")
  904. BodyColors59.RightArmColor = BrickColor.new("White")
  905. BodyColors59.RightLegColor = BrickColor.new("Medium blue")
  906. BodyColors59.TorsoColor = BrickColor.new("Light stone grey")
  907. CharacterMesh60.Parent = Model0
  908. CharacterMesh60.MeshId = 82907945
  909. CharacterMesh60.BodyPart = Enum.BodyPart.Torso
  910. Accessory61.Name = "Pal Hair"
  911. Accessory61.Parent = Model0
  912. Accessory61.AttachmentPos = Vector3.new(0, 0.25, 0.25)
  913. Part62.Name = "Handle"
  914. Part62.Parent = Accessory61
  915. Part62.Rotation = Vector3.new(-92.659996, -88.9000015, -92.6800003)
  916. Part62.CanCollide = false
  917. Part62.Locked = true
  918. Part62.FormFactor = Enum.FormFactor.Symmetric
  919. Part62.Size = Vector3.new(1, 1, 2)
  920. Part62.CFrame = CFrame.new(-32.5344772, 4.7477169, -62.3425903, -0.000896211772, 0.0191786997, -0.999815643, -0.000249207893, 0.99981606, 0.0191789325, 0.999999642, 0.000266350369, -0.000891267613)
  921. Part62.BottomSurface = Enum.SurfaceType.Smooth
  922. Part62.TopSurface = Enum.SurfaceType.Smooth
  923. Part62.Position = Vector3.new(-32.5344772, 4.7477169, -62.3425903)
  924. Part62.Orientation = Vector3.new(-1.10000002, -90.0499954, -0.00999999978)
  925. SpecialMesh63.Parent = Part62
  926. SpecialMesh63.MeshId = "http://www.roblox.com/asset/?id=83293901"
  927. SpecialMesh63.Scale = Vector3.new(1, 1.04999995, 1)
  928. SpecialMesh63.TextureId = "http://www.roblox.com/asset/?id=83284747"
  929. SpecialMesh63.VertexColor = Vector3.new(1.20000005, 1.39999998, 1.39999998)
  930. SpecialMesh63.MeshType = Enum.MeshType.FileMesh
  931. SpecialMesh63.Scale = Vector3.new(1, 1.04999995, 1)
  932. Attachment64.Name = "HairAttachment"
  933. Attachment64.Parent = Part62
  934. Attachment64.Rotation = Vector3.new(2.37457894e-14, -1.86912034e-22, -4.50996595e-07)
  935. Attachment64.CFrame = CFrame.new(8.65748007e-09, 0.349999905, 0.249727756, 1, 7.87137555e-09, -3.26223034e-24, -7.87137555e-09, 1, -4.1444221e-16, 0, 4.1444221e-16, 1)
  936. Attachment64.Position = Vector3.new(8.65748007e-09, 0.349999905, 0.249727756)
  937. Attachment64.Axis = Vector3.new(1, -7.87137555e-09, 0)
  938. Attachment64.Orientation = Vector3.new(2.37457894e-14, -1.86912034e-22, -4.50996595e-07)
  939. Vector3Value65.Name = "OriginalSize"
  940. Vector3Value65.Parent = Part62
  941. Vector3Value65.Value = Vector3.new(1, 1, 2)
  942. Pants66.Name = "Pants"
  943. Pants66.Parent = Model0
  944. Pants66.PantsTemplate = "http://www.roblox.com/asset/?id=144076759"
  945. CharacterMesh67.Parent = Model0
  946. CharacterMesh67.MeshId = 82907977
  947. CharacterMesh67.BodyPart = Enum.BodyPart.LeftArm
  948. CharacterMesh68.Parent = Model0
  949. CharacterMesh68.MeshId = 82908019
  950. CharacterMesh68.BodyPart = Enum.BodyPart.RightArm
  951. CharacterMesh69.Parent = Model0
  952. CharacterMesh69.MeshId = 81487710
  953. CharacterMesh69.BodyPart = Enum.BodyPart.RightLeg
  954. Part70.Parent = Model0
  955. Part70.Transparency = 1
  956. Part70.Rotation = Vector3.new(57.6599998, -89.9799957, 57.6499977)
  957. Part70.Size = Vector3.new(1, 1, 1)
  958. Part70.CFrame = CFrame.new(-32.809288, 2.50234795, -60.8433228, 0.000162442448, -0.000256485306, -0.99999994, -0.000184689823, 1, -0.000256515108, 1, 0.0001847315, 0.00016239511)
  959. Part70.BottomSurface = Enum.SurfaceType.Smooth
  960. Part70.TopSurface = Enum.SurfaceType.Smooth
  961. Part70.Position = Vector3.new(-32.809288, 2.50234795, -60.8433228)
  962. Part70.Orientation = Vector3.new(0.00999999978, -89.9899979, -0.00999999978)
  963. Part71.Parent = Model0
  964. Part71.Transparency = 1
  965. Part71.Rotation = Vector3.new(-88.8799973, -89.7599945, -88.8899994)
  966. Part71.Size = Vector3.new(1, 1, 1)
  967. Part71.CFrame = CFrame.new(-32.8111115, 2.50309348, -63.8433228, 8.19999914e-05, 0.00424200017, -0.999991, -0.000180000003, 0.999991, 0.00424198527, 1, 0.000179650538, 8.27628319e-05)
  968. Part71.BottomSurface = Enum.SurfaceType.Smooth
  969. Part71.TopSurface = Enum.SurfaceType.Smooth
  970. Part71.Position = Vector3.new(-32.8111115, 2.50309348, -63.8433228)
  971. Part71.Orientation = Vector3.new(-0.239999995, -90, -0.00999999978)
  972. Part72.Parent = Model0
  973. Part72.Transparency = 1
  974. Part72.Rotation = Vector3.new(-99.75, -89.7399979, -99.6999969)
  975. Part72.Size = Vector3.new(1, 1, 1)
  976. Part72.CFrame = CFrame.new(-32.8441582, 0.502851367, -61.8421822, -0.000776336063, 0.00454139849, -0.99998939, 0.000924410648, 0.999989271, 0.00454068044, 0.999999285, -0.000920875755, -0.00078052585)
  977. Part72.BottomSurface = Enum.SurfaceType.Smooth
  978. Part72.TopSurface = Enum.SurfaceType.Smooth
  979. Part72.Position = Vector3.new(-32.8441582, 0.502851367, -61.8421822)
  980. Part72.Orientation = Vector3.new(-0.25999999, -90.0400009, 0.049999997)
  981. Part73.Parent = Model0
  982. Part73.Transparency = 1
  983. Part73.Rotation = Vector3.new(79.3600006, -89.6399994, 79.3600006)
  984. Part73.Size = Vector3.new(1, 1, 1)
  985. Part73.CFrame = CFrame.new(-32.8272095, 0.503102541, -62.8435974, 0.00115803222, -0.00616325252, -0.99998033, -2.37580807e-05, 0.999980986, -0.00616328325, 0.999999404, 3.08949129e-05, 0.00115786388)
  986. Part73.BottomSurface = Enum.SurfaceType.Smooth
  987. Part73.TopSurface = Enum.SurfaceType.Smooth
  988. Part73.Position = Vector3.new(-32.8272095, 0.503102541, -62.8435974)
  989. Part73.Orientation = Vector3.new(0.349999994, -89.9300003, 0)
  990. Part74.Parent = Model0
  991. Part74.Transparency = 1
  992. Part74.Rotation = Vector3.new(-92.659996, -88.9000015, -92.6800003)
  993. Part74.Size = Vector3.new(1, 1, 1)
  994. Part74.CFrame = CFrame.new(-32.8081284, 3.50274992, -62.3431435, -0.000896211946, 0.0191786997, -0.999815643, -0.000249215751, 0.99981606, 0.0191789325, 0.999999642, 0.000266358227, -0.000891267613)
  995. Part74.BottomSurface = Enum.SurfaceType.Smooth
  996. Part74.TopSurface = Enum.SurfaceType.Smooth
  997. Part74.Position = Vector3.new(-32.8081284, 3.50274992, -62.3431435)
  998. Part74.Orientation = Vector3.new(-1.10000002, -90.0499954, -0.00999999978)
  999. Script75.Name = "Ragdoller"
  1000. Script75.Parent = Model0
  1001. table.insert(cors,sandbox(Script75,function()
  1002. print("Ragdoll script activated")
  1003. Gibs = game.Workspace
  1004.  
  1005. function getKillerOfHumanoidIfStillInGame(humanoid)
  1006. local tag = humanoid:findFirstChild("creator")
  1007. if tag ~= nil then
  1008. local killer = tag.Value
  1009. if killer.Parent ~= nil then
  1010. return killer
  1011. end
  1012. end
  1013. return nil
  1014. end
  1015.  
  1016. function OnDeath(Character)
  1017. local svch = Character
  1018. local hum = Character:findFirstChild("Humanoid")
  1019. local getkiller = getKillerOfHumanoidIfStillInGame(hum)
  1020. Character.Archivable = true
  1021. local chrclone = Character:clone()
  1022. Character.Archivable = false
  1023.  
  1024. local ch = chrclone:GetChildren()
  1025. local i
  1026. for i = 1,#ch do
  1027. if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" or ch[i].ClassName == "Script" then
  1028. ch[i]:remove()
  1029. end
  1030. end
  1031. local function Scan(ch)
  1032. local e
  1033. for e = 1,#ch do
  1034. Scan(ch[e]:GetChildren())
  1035. if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then
  1036. ch[e]:remove()
  1037. end
  1038. end
  1039. end
  1040. Scan(chrclone:GetChildren())
  1041.  
  1042. local hum2 = chrclone:findFirstChild("Humanoid")
  1043.  
  1044.  
  1045. if hum2 ~= nil then
  1046. hum2.Name = "Humanoid2"
  1047. hum2.PlatformStand = true
  1048. hum2.Sit = true
  1049. hum2.MaxHealth = 0
  1050. hum2.Health = 0
  1051. end
  1052.  
  1053. local ch = Character:GetChildren()
  1054. local i
  1055. for i = 1,#ch do
  1056. if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
  1057. ch[i]:remove()
  1058. end
  1059. end
  1060.  
  1061. wait(0.2)
  1062.  
  1063. local ch = Character:GetChildren()
  1064. local i
  1065. for i = 1,#ch do
  1066. if ch[i].ClassName == "Part" or ch[i].ClassName == "Hat" or ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
  1067. ch[i]:remove()
  1068. end
  1069. end
  1070. Character = chrclone
  1071. local Torso = Character.Torso
  1072. local movevector = Vector3.new()
  1073.  
  1074. if Torso then
  1075. if getkiller ~= nil then
  1076. if getkiller.Character ~= nil then
  1077. local killtors = getkiller.Character:findFirstChild("Torso")
  1078. if killtors ~= nil then
  1079. movevector = CFrame.new(killtors.Position,Torso.Position).lookVector
  1080. end
  1081. end
  1082. end
  1083. local Head = Character:FindFirstChild("Head")
  1084. if Head then
  1085. local Neck = Instance.new("Weld")
  1086. Neck.Name = "Neck"
  1087. Neck.Part0 = Torso
  1088. Neck.Part1 = Head
  1089. Neck.C0 = CFrame.new(0, 1.5, 0)
  1090. Neck.C1 = CFrame.new()
  1091. Neck.Parent = Torso
  1092.  
  1093. local nsc = script.CamAttach:clone()
  1094. nsc.CamPart.Value = hum2.Parent.Head
  1095. nsc.Disabled = false
  1096. nsc.Parent = svch
  1097. end
  1098. local Limb = Character:FindFirstChild("Right Arm")
  1099. if Limb then
  1100.  
  1101. Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
  1102. local Joint = Instance.new("Glue")
  1103. Joint.Name = "RightShoulder"
  1104. Joint.Part0 = Torso
  1105. Joint.Part1 = Limb
  1106. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1107. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1108. Joint.Parent = Torso
  1109.  
  1110. local B = Instance.new("Part")
  1111. B.TopSurface = 0
  1112. B.BottomSurface = 0
  1113. B.formFactor = "Symmetric"
  1114. B.Size = Vector3.new(1, 1, 1)
  1115. B.Transparency = 1
  1116. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  1117. B.Parent = Character
  1118. local W = Instance.new("Weld")
  1119. W.Part0 = Limb
  1120. W.Part1 = B
  1121. W.C0 = CFrame.new(0, -0.5, 0)
  1122. W.Parent = Limb
  1123.  
  1124. end
  1125. local Limb = Character:FindFirstChild("Left Arm")
  1126. if Limb then
  1127.  
  1128. Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
  1129. local Joint = Instance.new("Glue")
  1130. Joint.Name = "LeftShoulder"
  1131. Joint.Part0 = Torso
  1132. Joint.Part1 = Limb
  1133. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1134. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1135. Joint.Parent = Torso
  1136.  
  1137. local B = Instance.new("Part")
  1138. B.TopSurface = 0
  1139. B.BottomSurface = 0
  1140. B.formFactor = "Symmetric"
  1141. B.Size = Vector3.new(1, 1, 1)
  1142. B.Transparency = 1
  1143. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  1144. B.Parent = Character
  1145. local W = Instance.new("Weld")
  1146. W.Part0 = Limb
  1147. W.Part1 = B
  1148. W.C0 = CFrame.new(0, -0.5, 0)
  1149. W.Parent = Limb
  1150.  
  1151. end
  1152. local Limb = Character:FindFirstChild("Right Leg")
  1153. if Limb then
  1154.  
  1155. Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0)
  1156. local Joint = Instance.new("Glue")
  1157. Joint.Name = "RightHip"
  1158. Joint.Part0 = Torso
  1159. Joint.Part1 = Limb
  1160. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1161. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1162. Joint.Parent = Torso
  1163.  
  1164. local B = Instance.new("Part")
  1165. B.TopSurface = 0
  1166. B.BottomSurface = 0
  1167. B.formFactor = "Symmetric"
  1168. B.Size = Vector3.new(1, 1, 1)
  1169. B.Transparency = 1
  1170. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  1171. B.Parent = Character
  1172. local W = Instance.new("Weld")
  1173. W.Part0 = Limb
  1174. W.Part1 = B
  1175. W.C0 = CFrame.new(0, -0.5, 0)
  1176. W.Parent = Limb
  1177.  
  1178. end
  1179. local Limb = Character:FindFirstChild("Left Leg")
  1180. if Limb then
  1181.  
  1182. Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0)
  1183. local Joint = Instance.new("Glue")
  1184. Joint.Name = "LeftHip"
  1185. Joint.Part0 = Torso
  1186. Joint.Part1 = Limb
  1187. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1188. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1189. Joint.Parent = Torso
  1190.  
  1191. local B = Instance.new("Part")
  1192. B.TopSurface = 0
  1193. B.BottomSurface = 0
  1194. B.formFactor = "Symmetric"
  1195. B.Size = Vector3.new(1, 1, 1)
  1196. B.Transparency = 1
  1197. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  1198. B.Parent = Character
  1199. local W = Instance.new("Weld")
  1200. W.Part0 = Limb
  1201. W.Part1 = B
  1202. W.C0 = CFrame.new(0, -0.5, 0)
  1203. W.Parent = Limb
  1204.  
  1205. end
  1206. --[
  1207. local Bar = Instance.new("Part")
  1208. Bar.TopSurface = 0
  1209. Bar.BottomSurface = 0
  1210. Bar.formFactor = "Symmetric"
  1211. Bar.Size = Vector3.new(1, 1, 1)
  1212. Bar.Transparency = 1
  1213. Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
  1214. Bar.Parent = Character
  1215. local Weld = Instance.new("Weld")
  1216. Weld.Part0 = Torso
  1217. Weld.Part1 = Bar
  1218. Weld.C0 = CFrame.new(0, 0.5, 0)
  1219. Weld.Parent = Torso
  1220. --]]
  1221. end
  1222. Character.Parent = Gibs
  1223. game.Debris:AddItem(Character, 12)
  1224. if movevector ~= Vector3.new() then
  1225. for i = 1,10 do
  1226. wait()
  1227. Torso.Velocity = movevector * 30
  1228. end
  1229. end
  1230. end
  1231.  
  1232. script.Parent.Humanoid.Died:connect(function()
  1233. OnDeath(script.Parent)
  1234. end)
  1235.  
  1236.  
  1237. end))
  1238. LocalScript76.Name = "CamAttach"
  1239. LocalScript76.Parent = Script75
  1240. LocalScript76.Disabled = true
  1241. table.insert(cors,sandbox(LocalScript76,function()
  1242. wait()
  1243. game.Workspace.CurrentCamera.CameraSubject = script.CamPart.Value
  1244. end))
  1245. ObjectValue77.Name = "CamPart"
  1246. ObjectValue77.Parent = LocalScript76
  1247. for i,v in pairs(mas:GetChildren()) do
  1248. v.Parent = workspace
  1249. pcall(function() v:MakeJoints() end)
  1250. end
  1251. mas:Destroy()
  1252. for i,v in pairs(cors) do
  1253. spawn(function()
  1254. pcall(v)
  1255. end)
  1256. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement