Advertisement
lafur

Untitled

Oct 19th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 54.68 KB | None | 0 0
  1. --Created by PenguinAnonymous (ttyyuu12345) Editied by Dittoide
  2. --What's Added To M2S with Dittoide's Edit?
  3. --/ Better dummy script function to improve compatibility (makes it like you are running the code inside the script.)
  4. --/ Removed Gui In Bottom-Left for when you are making guis.
  5. --/ Removed "Inserting Map Please Wait" gui when selected Workspace as Place to export.
  6. --Credit: PenguinAnonymous for making original script, i just wanted to iron it out to my liking.
  7. --Errors: Camera,Terrain,Attachment,Status,Animator,Accessory
  8. local runDummyScript = function(f,scri)
  9. if (not scri:IsA('Script')) or (not scri:IsA('LocalScript')) then return false; end;
  10. local Dummy_CoRoutine = coroutine.create(function()
  11. getfenv().script = scri
  12. ypcall(function() f() end)
  13. end)
  14. table.insert(cors,Dummy_CoRoutine);
  15. coroutine.resume(Dummy_CoRoutine);
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. mas.Name = "M2S_Model"
  20. o3 = Instance.new("Model")
  21. o4 = Instance.new("Script")
  22. o5 = Instance.new("Model")
  23. o6 = Instance.new("Model")
  24. o7 = Instance.new("Part")
  25. o8 = Instance.new("SpecialMesh")
  26. o9 = Instance.new("Part")
  27. o10 = Instance.new("Part")
  28. o11 = Instance.new("Part")
  29. o12 = Instance.new("Part")
  30. o13 = Instance.new("Part")
  31. o14 = Instance.new("Model")
  32. o15 = Instance.new("Part")
  33. o16 = Instance.new("SpecialMesh")
  34. o21 = Instance.new("Sound")
  35. o22 = Instance.new("RemoteEvent")
  36. o23 = Instance.new("Sound")
  37. o24 = Instance.new("RemoteEvent")
  38. o25 = Instance.new("Sound")
  39. o26 = Instance.new("RemoteEvent")
  40. o27 = Instance.new("Sound")
  41. o28 = Instance.new("RemoteEvent")
  42. o29 = Instance.new("Sound")
  43. o30 = Instance.new("RemoteEvent")
  44. o31 = Instance.new("Sound")
  45. o32 = Instance.new("RemoteEvent")
  46. o33 = Instance.new("Sound")
  47. o34 = Instance.new("RemoteEvent")
  48. o35 = Instance.new("Sound")
  49. o36 = Instance.new("RemoteEvent")
  50. o37 = Instance.new("Sound")
  51. o38 = Instance.new("RemoteEvent")
  52. o39 = Instance.new("Decal")
  53. o40 = Instance.new("Part")
  54. o41 = Instance.new("Decal")
  55. o50 = Instance.new("Motor6D")
  56. o51 = Instance.new("Motor6D")
  57. o52 = Instance.new("Motor6D")
  58. o53 = Instance.new("Motor6D")
  59. o54 = Instance.new("Motor6D")
  60. o55 = Instance.new("Part")
  61. o58 = Instance.new("Part")
  62. o61 = Instance.new("Part")
  63. o63 = Instance.new("Part")
  64. o65 = Instance.new("Humanoid")
  65. o68 = Instance.new("Part")
  66. o70 = Instance.new("Motor6D")
  67. o71 = Instance.new("Script")
  68. o72 = Instance.new("LocalScript")
  69. o73 = Instance.new("Script")
  70. o74 = Instance.new("LocalScript")
  71. o75 = Instance.new("StringValue")
  72. o76 = Instance.new("Animation")
  73. o77 = Instance.new("NumberValue")
  74. o78 = Instance.new("Animation")
  75. o79 = Instance.new("NumberValue")
  76. o80 = Instance.new("StringValue")
  77. o81 = Instance.new("Animation")
  78. o82 = Instance.new("StringValue")
  79. o83 = Instance.new("Animation")
  80. o84 = Instance.new("StringValue")
  81. o85 = Instance.new("Animation")
  82. o86 = Instance.new("StringValue")
  83. o87 = Instance.new("Animation")
  84. o88 = Instance.new("StringValue")
  85. o89 = Instance.new("Animation")
  86. o90 = Instance.new("StringValue")
  87. o91 = Instance.new("Animation")
  88. o92 = Instance.new("StringValue")
  89. o93 = Instance.new("Animation")
  90. o94 = Instance.new("NumberValue")
  91. o95 = Instance.new("BodyColors")
  92. o96 = Instance.new("Pants")
  93. o98 = Instance.new("Part")
  94. o99 = Instance.new("SpecialMesh")
  95. o101 = Instance.new("Vector3Value")
  96. o102 = Instance.new("Weld")
  97. o103 = Instance.new("Shirt")
  98. o3.Name = "Compiled scripts"
  99. o3.Parent = mas
  100. o4.Name = "CScript1"
  101. o4.Parent = o3
  102. o4.Disabled = true
  103.  
  104. runDummyScript(function()
  105. --Created by PenguinAnonymous (ttyyuu12345) Editied by Dittoide
  106. --What's Added To M2S with Dittoide's Edit?
  107. --/ Better dummy script function to improve compatibility (makes it like you are running the code inside the script.)
  108. --/ Removed Gui In Bottom-Left for when you are making guis.
  109. --/ Removed "Inserting Map Please Wait" gui when selected Workspace as Place to export.
  110. --Credit: PenguinAnonymous for making original script, i just wanted to iron it out to my liking.
  111. --Errors: Camera,Terrain
  112. local runDummyScript = function(f,scri)
  113. if (not scri:IsA('Script')) or (not scri:IsA('LocalScript')) then return false; end;
  114. local Dummy_CoRoutine = coroutine.create(function()
  115. getfenv().script = scri
  116. ypcall(function() f() end)
  117. end)
  118. table.insert(cors,Dummy_CoRoutine);
  119. coroutine.resume(Dummy_CoRoutine);
  120. end
  121. cors = {}
  122. mas = Instance.new("Model",game:GetService("Lighting"))
  123. mas.Name = "M2S_Model"
  124. o3 = Instance.new("Model")
  125. o4 = Instance.new("Part")
  126. o5 = Instance.new("SpecialMesh")
  127. o6 = Instance.new("Part")
  128. o7 = Instance.new("Part")
  129. o8 = Instance.new("Part")
  130. o9 = Instance.new("Part")
  131. o10 = Instance.new("Part")
  132. o3.Parent = mas
  133. o4.Parent = o3
  134. o4.BrickColor = BrickColor.new("Dark stone grey")
  135. o4.Transparency = 0.30000001192093
  136. o4.Position = Vector3.new(-19.7996979, 32.7543106, 52)
  137. o4.Rotation = Vector3.new(-86.5400009, 29.9599991, -1.73000002)
  138. o4.Size = Vector3.new(4, 2.4000001, 2)
  139. o4.CFrame = CFrame.new(-19.7996979, 32.7543106, 52, 0.865938365, 0.0261758789, 0.499465615, -0.500151098, 0.0453196988, 0.864751697, 1.86264537e-09, -0.998629689, 0.052335944)
  140. o4.Color = Color3.new(0.388235, 0.372549, 0.384314)
  141. o4.Position = Vector3.new(-19.7996979, 32.7543106, 52)
  142. o5.Parent = o4
  143. o5.MeshId = "http://www.roblox.com/asset/?id=12221720"
  144. o5.Scale = Vector3.new(4, 4, 4)
  145. o5.MeshType = Enum.MeshType.FileMesh
  146. o6.Parent = o3
  147. o6.BrickColor = BrickColor.new("Dark stone grey")
  148. o6.Position = Vector3.new(-26, 21.7224236, 51)
  149. o6.Rotation = Vector3.new(-90, -59.9899979, 90)
  150. o6.Size = Vector3.new(4, 9.60000038, 4)
  151. o6.CFrame = CFrame.new(-26, 21.7224236, 51, 0, -0.500150919, -0.865937889, 0, -0.865937889, 0.500150919, -1, 0, 0)
  152. o6.BottomSurface = Enum.SurfaceType.Smooth
  153. o6.TopSurface = Enum.SurfaceType.Smooth
  154. o6.Color = Color3.new(0.388235, 0.372549, 0.384314)
  155. o6.Position = Vector3.new(-26, 21.7224236, 51)
  156. o7.Parent = o3
  157. o7.BrickColor = BrickColor.new("Dark stone grey")
  158. o7.Position = Vector3.new(-32, 16.7224045, 51)
  159. o7.Rotation = Vector3.new(0, 90, 0)
  160. o7.Size = Vector3.new(4, 9.60000038, 8)
  161. o7.CFrame = CFrame.new(-32, 16.7224045, 51, -0, 0, 1, -0, 1, 0, -1, 0, 0)
  162. o7.TopSurface = Enum.SurfaceType.Smooth
  163. o7.Color = Color3.new(0.388235, 0.372549, 0.384314)
  164. o7.Position = Vector3.new(-32, 16.7224045, 51)
  165. o8.Parent = o3
  166. o8.BrickColor = BrickColor.new("Dark stone grey")
  167. o8.Position = Vector3.new(-39.0000038, 17.5224171, 51)
  168. o8.Rotation = Vector3.new(90, 69, -90)
  169. o8.Size = Vector3.new(4, 9.60000038, 4)
  170. o8.CFrame = CFrame.new(-39.0000038, 17.5224171, 51, 0, 0.358368039, 0.933580935, 0, 0.933580935, -0.358368039, -1, 0, 0)
  171. o8.BottomSurface = Enum.SurfaceType.Smooth
  172. o8.TopSurface = Enum.SurfaceType.Smooth
  173. o8.Color = Color3.new(0.388235, 0.372549, 0.384314)
  174. o8.Position = Vector3.new(-39.0000038, 17.5224171, 51)
  175. o9.Parent = o3
  176. o9.BrickColor = BrickColor.new("Dark stone grey")
  177. o9.Position = Vector3.new(-29, 7.72241306, 51)
  178. o9.Rotation = Vector3.new(-90, 75, 90)
  179. o9.Size = Vector3.new(4, 10.8000002, 4)
  180. o9.CFrame = CFrame.new(-29, 7.72241306, 51, 0, -0.258819133, 0.96592629, 0, 0.96592629, 0.258819133, -1, 0, 0)
  181. o9.TopSurface = Enum.SurfaceType.Smooth
  182. o9.Color = Color3.new(0.388235, 0.372549, 0.384314)
  183. o9.Position = Vector3.new(-29, 7.72241306, 51)
  184. o10.Parent = o3
  185. o10.BrickColor = BrickColor.new("Dark stone grey")
  186. o10.Position = Vector3.new(-34, 7.12241077, 51)
  187. o10.Rotation = Vector3.new(0, 90, 0)
  188. o10.Size = Vector3.new(4, 9.60000038, 4)
  189. o10.CFrame = CFrame.new(-34, 7.12241077, 51, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  190. o10.TopSurface = Enum.SurfaceType.Smooth
  191. o10.Color = Color3.new(0.388235, 0.372549, 0.384314)
  192. o10.Position = Vector3.new(-34, 7.12241077, 51)
  193. mas.Parent = workspace
  194. mas:MakeJoints()
  195. local mas1 = mas:GetChildren()
  196. for i=1,#mas1 do
  197. mas1[i].Parent = workspace
  198. ypcall(function() mas1[i]:MakeJoints() end)
  199. end
  200. mas:Destroy()
  201. for i=1,#cors do
  202. coroutine.resume(cors[i])
  203. end
  204. mess_handle.Text = "Resetting"
  205. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  206. v:LoadCharacter()
  207. end
  208. wait(1)
  209. mess_handle:Remove()
  210.  
  211. end,o4)
  212.  
  213. o5.Parent = mas
  214. o6.Parent = o5
  215. o7.Parent = o6
  216. o7.BrickColor = BrickColor.new("Dark stone grey")
  217. o7.Transparency = 0.30000001192093
  218. o7.Position = Vector3.new(-19.7996979, 32.7543106, 52)
  219. o7.Rotation = Vector3.new(-86.5400009, 29.9599991, -1.73000002)
  220. o7.Anchored = true
  221. o7.Size = Vector3.new(4, 2.4000001, 2)
  222. o7.CFrame = CFrame.new(-19.7996979, 32.7543106, 52, 0.865948319, 0.0261648297, 0.499448657, -0.500133574, 0.0452957153, 0.864762843, 3.50177288e-06, -0.998630941, 0.0523096323)
  223. o7.Color = Color3.new(0.388235, 0.372549, 0.384314)
  224. o7.Position = Vector3.new(-19.7996979, 32.7543106, 52)
  225. o8.Parent = o7
  226. o8.MeshId = "http://www.roblox.com/asset/?id=12221720"
  227. o8.Scale = Vector3.new(4, 4, 4)
  228. o8.MeshType = Enum.MeshType.FileMesh
  229. o9.Parent = o6
  230. o9.BrickColor = BrickColor.new("Dark stone grey")
  231. o9.Position = Vector3.new(-26, 21.7224236, 51)
  232. o9.Rotation = Vector3.new(-90, -59.9899979, 90)
  233. o9.Anchored = true
  234. o9.Size = Vector3.new(4, 9.60000038, 4)
  235. o9.CFrame = CFrame.new(-26, 21.7224236, 51, 3.40938568e-05, -0.500193477, -0.86591363, -9.14931297e-06, -0.86591363, 0.500193477, -1, -9.14931297e-06, -3.40938568e-05)
  236. o9.BottomSurface = Enum.SurfaceType.Smooth
  237. o9.TopSurface = Enum.SurfaceType.Smooth
  238. o9.Color = Color3.new(0.388235, 0.372549, 0.384314)
  239. o9.Position = Vector3.new(-26, 21.7224236, 51)
  240. o10.Parent = o6
  241. o10.BrickColor = BrickColor.new("Dark stone grey")
  242. o10.Position = Vector3.new(-32, 16.7224045, 51)
  243. o10.Rotation = Vector3.new(0, 90, 0)
  244. o10.Anchored = true
  245. o10.Size = Vector3.new(4, 9.60000038, 8)
  246. o10.CFrame = CFrame.new(-32, 16.7224045, 51, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  247. o10.TopSurface = Enum.SurfaceType.Smooth
  248. o10.Color = Color3.new(0.388235, 0.372549, 0.384314)
  249. o10.Position = Vector3.new(-32, 16.7224045, 51)
  250. o11.Parent = o6
  251. o11.BrickColor = BrickColor.new("Dark stone grey")
  252. o11.Position = Vector3.new(-39.0000038, 17.5224171, 51)
  253. o11.Rotation = Vector3.new(90.0099945, 69, -90.0099945)
  254. o11.Anchored = true
  255. o11.Size = Vector3.new(4, 9.60000038, 4)
  256. o11.CFrame = CFrame.new(-39.0000038, 17.5224171, 51, -4.99486923e-05, 0.358418405, 0.933561087, 9.2536211e-06, 0.933561087, -0.358418405, -1, -9.2536211e-06, -4.99486923e-05)
  257. o11.BottomSurface = Enum.SurfaceType.Smooth
  258. o11.TopSurface = Enum.SurfaceType.Smooth
  259. o11.Color = Color3.new(0.388235, 0.372549, 0.384314)
  260. o11.Position = Vector3.new(-39.0000038, 17.5224171, 51)
  261. o12.Parent = o6
  262. o12.BrickColor = BrickColor.new("Dark stone grey")
  263. o12.Position = Vector3.new(-29, 7.72241306, 51)
  264. o12.Rotation = Vector3.new(-90, 75, 90)
  265. o12.Anchored = true
  266. o12.Size = Vector3.new(4, 10.8000002, 4)
  267. o12.CFrame = CFrame.new(-29, 7.72241306, 51, -1.26361847e-05, -0.258770168, 0.965938866, -1.68383121e-06, 0.965938926, 0.258770168, -0.99999994, 1.68383121e-06, -1.26361847e-05)
  268. o12.TopSurface = Enum.SurfaceType.Smooth
  269. o12.Color = Color3.new(0.388235, 0.372549, 0.384314)
  270. o12.Position = Vector3.new(-29, 7.72241306, 51)
  271. o13.Parent = o6
  272. o13.BrickColor = BrickColor.new("Dark stone grey")
  273. o13.Position = Vector3.new(-34, 7.12241077, 51)
  274. o13.Rotation = Vector3.new(0, 90, 0)
  275. o13.Anchored = true
  276. o13.Size = Vector3.new(4, 9.60000038, 4)
  277. o13.CFrame = CFrame.new(-34, 7.12241077, 51, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  278. o13.TopSurface = Enum.SurfaceType.Smooth
  279. o13.Color = Color3.new(0.388235, 0.372549, 0.384314)
  280. o13.Position = Vector3.new(-34, 7.12241077, 51)
  281. o14.Name = "timetodie23232223"
  282. o14.Parent = mas
  283. o14.Archivable = false
  284. o14.PrimaryPart = o15
  285. o15.Name = "Head"
  286. o15.Parent = o14
  287. o15.BrickColor = BrickColor.new("Pastel brown")
  288. o15.Position = Vector3.new(-24.0668049, 6.47494841, 40.683567)
  289. o15.Rotation = Vector3.new(-0.269999981, -34.9199982, -0.159999996)
  290. o15.Locked = true
  291. o15.FormFactor = Enum.FormFactor.Symmetric
  292. o15.Size = Vector3.new(2, 1, 1)
  293. o15.CFrame = CFrame.new(-24.0668049, 6.47494841, 40.683567, 0.819974363, 0.00224036095, -0.572395802, -1.41710725e-05, 0.99999243, 0.00389366131, 0.572400212, -0.00318458513, 0.819968224)
  294. o15.TopSurface = Enum.SurfaceType.Smooth
  295. o15.Color = Color3.new(1, 0.8, 0.6)
  296. o15.Position = Vector3.new(-24.0668049, 6.47494841, 40.683567)
  297. o16.Parent = o15
  298. o16.Scale = Vector3.new(1.25, 1.25, 1.25)
  299. o21.Name = "GettingUp"
  300. o21.Parent = o15
  301. o21.Archivable = false
  302. o21.SoundId = "rbxasset://sounds/action_get_up.mp3"
  303. o21.Volume = 0.64999997615814
  304. o22.Name = "CharacterSoundEvent"
  305. o22.Parent = o21
  306. o23.Name = "Died"
  307. o23.Parent = o15
  308. o23.Archivable = false
  309. o23.SoundId = "rbxasset://sounds/uuhhh.mp3"
  310. o23.Volume = 0.64999997615814
  311. o24.Name = "CharacterSoundEvent"
  312. o24.Parent = o23
  313. o25.Name = "FreeFalling"
  314. o25.Parent = o15
  315. o25.Archivable = false
  316. o25.SoundId = "rbxasset://sounds/action_falling.mp3"
  317. o25.TimePosition = 0.20340387445407
  318. o25.Volume = 1
  319. o25.Looped = true
  320. o26.Name = "CharacterSoundEvent"
  321. o26.Parent = o25
  322. o27.Name = "Jumping"
  323. o27.Parent = o15
  324. o27.Archivable = false
  325. o27.SoundId = "rbxasset://sounds/action_jump.mp3"
  326. o27.Volume = 0.64999997615814
  327. o28.Name = "CharacterSoundEvent"
  328. o28.Parent = o27
  329. o29.Name = "Landing"
  330. o29.Parent = o15
  331. o29.Archivable = false
  332. o29.SoundId = "rbxasset://sounds/action_jump_land.mp3"
  333. o29.Volume = 1
  334. o30.Name = "CharacterSoundEvent"
  335. o30.Parent = o29
  336. o31.Name = "Splash"
  337. o31.Parent = o15
  338. o31.Archivable = false
  339. o31.SoundId = "rbxasset://sounds/impact_water.mp3"
  340. o31.Volume = 0.64999997615814
  341. o32.Name = "CharacterSoundEvent"
  342. o32.Parent = o31
  343. o33.Name = "Running"
  344. o33.Parent = o15
  345. o33.Archivable = false
  346. o33.Pitch = 1.8500000238419
  347. o33.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  348. o33.TimePosition = 0.85750264926479
  349. o33.Volume = 0.64999997615814
  350. o33.Looped = true
  351. o34.Name = "CharacterSoundEvent"
  352. o34.Parent = o33
  353. o35.Name = "Swimming"
  354. o35.Parent = o15
  355. o35.Archivable = false
  356. o35.Pitch = 1.6000000238419
  357. o35.SoundId = "rbxasset://sounds/action_swim.mp3"
  358. o35.Volume = 0.64999997615814
  359. o35.Looped = true
  360. o36.Name = "CharacterSoundEvent"
  361. o36.Parent = o35
  362. o37.Name = "Climbing"
  363. o37.Parent = o15
  364. o37.Archivable = false
  365. o37.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  366. o37.Volume = 0.64999997615814
  367. o37.Looped = true
  368. o38.Name = "CharacterSoundEvent"
  369. o38.Parent = o37
  370. o39.Name = "face"
  371. o39.Parent = o15
  372. o39.Texture = "http://www.roblox.com/asset/?id=13038247"
  373. o40.Name = "Torso"
  374. o40.Parent = o14
  375. o40.BrickColor = BrickColor.new("Pastel brown")
  376. o40.Position = Vector3.new(-24.0679245, 4.97538948, 40.6851578)
  377. o40.Rotation = Vector3.new(0, -35.1300011, 0)
  378. o40.Locked = true
  379. o40.FormFactor = Enum.FormFactor.Symmetric
  380. o40.Size = Vector3.new(2, 2, 1)
  381. o40.CFrame = CFrame.new(-24.0679245, 4.97538948, 40.6851578, 0.817877471, -1.04487619e-07, -0.575392425, 5.639804e-08, 1, -1.01428057e-07, 0.575392425, 5.05047169e-08, 0.817877471)
  382. o40.LeftSurface = Enum.SurfaceType.Weld
  383. o40.RightSurface = Enum.SurfaceType.Weld
  384. o40.Color = Color3.new(1, 0.8, 0.6)
  385. o40.Position = Vector3.new(-24.0679245, 4.97538948, 40.6851578)
  386. o41.Name = "roblox"
  387. o41.Parent = o40
  388. o50.Name = "Right Shoulder"
  389. o50.Parent = o40
  390. o50.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  391. o50.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  392. o50.Part0 = o40
  393. o50.Part1 = o58
  394. o50.CurrentAngle = 0.0067748897708952
  395. o50.MaxVelocity = 0.10000000149012
  396. o51.Name = "Left Shoulder"
  397. o51.Parent = o40
  398. o51.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  399. o51.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  400. o51.Part0 = o40
  401. o51.Part1 = o55
  402. o51.CurrentAngle = -0.0048912507481873
  403. o51.MaxVelocity = 0.10000000149012
  404. o52.Name = "Right Hip"
  405. o52.Parent = o40
  406. o52.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  407. o52.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  408. o52.Part0 = o40
  409. o52.Part1 = o63
  410. o52.MaxVelocity = 0.10000000149012
  411. o53.Name = "Left Hip"
  412. o53.Parent = o40
  413. o53.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  414. o53.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  415. o53.Part0 = o40
  416. o53.Part1 = o61
  417. o53.MaxVelocity = 0.10000000149012
  418. o54.Name = "Neck"
  419. o54.Parent = o40
  420. o54.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  421. o54.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  422. o54.Part0 = o40
  423. o54.Part1 = o15
  424. o54.CurrentAngle = 0.0017011311138049
  425. o54.MaxVelocity = 0.10000000149012
  426. o55.Name = "Left Arm"
  427. o55.Parent = o14
  428. o55.BrickColor = BrickColor.new("Pastel brown")
  429. o55.Position = Vector3.new(-25.2920303, 4.99553108, 39.8180618)
  430. o55.Rotation = Vector3.new(0.0799999982, -35.6100006, 0.0299999993)
  431. o55.CanCollide = false
  432. o55.Locked = true
  433. o55.FormFactor = Enum.FormFactor.Symmetric
  434. o55.Size = Vector3.new(1, 2, 1)
  435. o55.CFrame = CFrame.new(-25.2920303, 4.99553108, 39.8180618, 0.812950552, -0.000495347544, -0.582332551, -0.000223319279, 0.999999285, -0.00116239686, 0.582332671, 0.00107502041, 0.812949896)
  436. o55.Color = Color3.new(1, 0.8, 0.6)
  437. o55.Position = Vector3.new(-25.2920303, 4.99553108, 39.8180618)
  438. o58.Name = "Right Arm"
  439. o58.Parent = o14
  440. o58.BrickColor = BrickColor.new("Pastel brown")
  441. o58.Position = Vector3.new(-22.8415451, 5.00299072, 41.5513611)
  442. o58.Rotation = Vector3.new(-0.189999998, -35.2900009, 0.049999997)
  443. o58.CanCollide = false
  444. o58.Locked = true
  445. o58.FormFactor = Enum.FormFactor.Symmetric
  446. o58.Size = Vector3.new(1, 2, 1)
  447. o58.CFrame = CFrame.new(-22.8415451, 5.00299072, 41.5513611, 0.816229939, -0.000772229396, -0.577726662, 0.00288561243, 0.999992073, 0.00274024741, 0.577719927, -0.0039037643, 0.816225767)
  448. o58.Color = Color3.new(1, 0.8, 0.6)
  449. o58.Position = Vector3.new(-22.8415451, 5.00299072, 41.5513611)
  450. o61.Name = "Left Leg"
  451. o61.Parent = o14
  452. o61.BrickColor = BrickColor.new("Pastel brown")
  453. o61.Position = Vector3.new(-24.4768639, 2.99952984, 40.3974609)
  454. o61.Rotation = Vector3.new(0, -35.1300011, 0)
  455. o61.CanCollide = false
  456. o61.Locked = true
  457. o61.FormFactor = Enum.FormFactor.Symmetric
  458. o61.Size = Vector3.new(1, 2, 1)
  459. o61.CFrame = CFrame.new(-24.4768639, 2.99952984, 40.3974609, 0.817877471, -1.04487619e-07, -0.575392425, 5.639804e-08, 1, -1.01428057e-07, 0.575392425, 5.05047169e-08, 0.817877471)
  460. o61.BottomSurface = Enum.SurfaceType.Smooth
  461. o61.Color = Color3.new(1, 0.8, 0.6)
  462. o61.Position = Vector3.new(-24.4768639, 2.99952984, 40.3974609)
  463. o63.Name = "Right Leg"
  464. o63.Parent = o14
  465. o63.BrickColor = BrickColor.new("Pastel brown")
  466. o63.Position = Vector3.new(-23.6589851, 2.99616575, 40.9728546)
  467. o63.Rotation = Vector3.new(0, -35.1300011, 0)
  468. o63.CanCollide = false
  469. o63.Locked = true
  470. o63.FormFactor = Enum.FormFactor.Symmetric
  471. o63.Size = Vector3.new(1, 2, 1)
  472. o63.CFrame = CFrame.new(-23.6589851, 2.99616575, 40.9728546, 0.817877471, -1.04487619e-07, -0.575392425, 5.639804e-08, 1, -1.01428057e-07, 0.575392425, 5.05047169e-08, 0.817877471)
  473. o63.BottomSurface = Enum.SurfaceType.Smooth
  474. o63.Color = Color3.new(1, 0.8, 0.6)
  475. o63.Position = Vector3.new(-23.6589851, 2.99616575, 40.9728546)
  476. o65.Parent = o14
  477. o65.RightLeg = o63
  478. o65.LeftLeg = o61
  479. o65.Torso = o68
  480. o68.Name = "HumanoidRootPart"
  481. o68.Parent = o14
  482. o68.Transparency = 1
  483. o68.Position = Vector3.new(-24.0679245, 5, 40.6851578)
  484. o68.Rotation = Vector3.new(0, -35.1300011, 0)
  485. o68.CanCollide = false
  486. o68.Locked = true
  487. o68.FormFactor = Enum.FormFactor.Symmetric
  488. o68.Size = Vector3.new(2, 2, 1)
  489. o68.CFrame = CFrame.new(-24.0679245, 5, 40.6851578, 0.817877471, -1.04487619e-07, -0.575392425, 5.639804e-08, 1, -1.01428057e-07, 0.575392425, 5.05047169e-08, 0.817877471)
  490. o68.BottomSurface = Enum.SurfaceType.Smooth
  491. o68.TopSurface = Enum.SurfaceType.Smooth
  492. o68.Position = Vector3.new(-24.0679245, 5, 40.6851578)
  493. o70.Name = "RootJoint"
  494. o70.Parent = o68
  495. o70.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  496. o70.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  497. o70.Part0 = o68
  498. o70.Part1 = o40
  499. o70.MaxVelocity = 0.10000000149012
  500. o71.Name = "Sound"
  501. o71.Parent = o14
  502.  
  503. runDummyScript(function()
  504. --[[
  505. Author: @spotco
  506. This script creates sounds which are placed under the character head.
  507. These sounds are used by the "LocalSound" script.
  508.  
  509. To modify this script, copy it to your "StarterPlayer/StarterCharacterScripts" folder keeping the same script name ("Sound").
  510. The default Sound script loaded for every character will then be replaced with your copy of the script.
  511. ]]--
  512. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  513. local Players = game:GetService("Players")
  514.  
  515. local SOUND_EVENT_FOLDER_NAME = "DefaultSoundEvents"
  516. local DEFAULT_SERVER_SOUND_EVENT_NAME = "DefaultServerSoundEvent"
  517.  
  518. local SoundEventFolder = ReplicatedStorage:FindFirstChild(SOUND_EVENT_FOLDER_NAME)
  519. local DefaultServerSoundEvent = nil
  520.  
  521. local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
  522. if useSoundDispatcher then
  523. if not SoundEventFolder then
  524. SoundEventFolder = Instance.new("Folder")
  525. SoundEventFolder.Name = SOUND_EVENT_FOLDER_NAME
  526. SoundEventFolder.Archivable = false
  527. SoundEventFolder.Parent = ReplicatedStorage
  528. end
  529.  
  530. DefaultServerSoundEvent = SoundEventFolder:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
  531. else
  532. DefaultServerSoundEvent = ReplicatedStorage:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
  533. end
  534.  
  535. if not DefaultServerSoundEvent then
  536. if useSoundDispatcher then
  537. DefaultServerSoundEvent = Instance.new("RemoteEvent", SoundEventFolder)
  538. else
  539. DefaultServerSoundEvent = Instance.new("RemoteEvent", ReplicatedStorage)
  540. end
  541.  
  542. DefaultServerSoundEvent.Name = DEFAULT_SERVER_SOUND_EVENT_NAME
  543. DefaultServerSoundEvent.OnServerEvent:Connect(function() end)
  544. end
  545.  
  546. local function CreateNewSound(name, id, looped, pitch, parent)
  547. local sound = Instance.new("Sound")
  548. sound.SoundId = id
  549. sound.Name = name
  550. sound.archivable = false
  551. sound.Pitch = pitch
  552. sound.Looped = looped
  553. sound.MinDistance = 5
  554. sound.MaxDistance = 150
  555. sound.Volume = 0.65
  556. sound.Parent = parent
  557.  
  558. if DefaultServerSoundEvent then
  559. local CharacterSoundEvent = Instance.new("RemoteEvent", sound)
  560. CharacterSoundEvent.Name = "CharacterSoundEvent"
  561. CharacterSoundEvent.OnServerEvent:Connect(function(player, playing, resetPosition)
  562. if type(playing) ~= "boolean" then
  563. return
  564. end
  565. if type(resetPosition) ~= "boolean" then
  566. return
  567. end
  568.  
  569. if player.Character ~= script.Parent then
  570. return
  571. end
  572. for _, p in pairs(Players:GetPlayers()) do
  573. if p ~= player then
  574. -- Connect to the dispatcher to check if the player has loaded.
  575. if useSoundDispatcher then
  576. SoundEventFolder:FindFirstChild("SoundDispatcher"):Fire(p, sound, playing, resetPosition)
  577. else
  578. DefaultServerSoundEvent:FireClient(p, sound, playing, resetPosition)
  579. end
  580. end
  581. end
  582. end)
  583. end
  584. return sound
  585. end
  586.  
  587. local head = script.Parent:FindFirstChild("Head")
  588. if not head then
  589. error("Sound script parent has no child Head.")
  590. return
  591. end
  592.  
  593. CreateNewSound("GettingUp", "rbxasset://sounds/action_get_up.mp3", false, 1, head)
  594. CreateNewSound("Died", "rbxasset://sounds/uuhhh.mp3", false, 1, head)
  595. CreateNewSound("FreeFalling", "rbxasset://sounds/action_falling.mp3", true, 1, head)
  596. CreateNewSound("Jumping", "rbxasset://sounds/action_jump.mp3", false, 1, head)
  597. CreateNewSound("Landing", "rbxasset://sounds/action_jump_land.mp3", false, 1, head)
  598. CreateNewSound("Splash", "rbxasset://sounds/impact_water.mp3", false, 1, head)
  599. CreateNewSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1.85, head)
  600. CreateNewSound("Swimming", "rbxasset://sounds/action_swim.mp3", true, 1.6, head)
  601. CreateNewSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1, head)
  602. end,o71)
  603.  
  604. o72.Name = "LocalSound"
  605. o72.Parent = o71
  606.  
  607. runDummyScript(function()
  608. --[[
  609. Author: @spotco
  610. This script runs locally for the player of the given humanoid.
  611. This script triggers humanoid sound play/pause actions locally.
  612.  
  613. The Playing/TimePosition properties of Sound objects bypass FilteringEnabled, so this triggers the sound
  614. immediately for the player and is replicated to all other players.
  615.  
  616. This script is optimized to reduce network traffic through minimizing the amount of property replication.
  617. ]]--
  618.  
  619. --All sounds are referenced by this ID
  620. local SFX = {
  621. Died = 0;
  622. Running = 1;
  623. Swimming = 2;
  624. Climbing = 3,
  625. Jumping = 4;
  626. GettingUp = 5;
  627. FreeFalling = 6;
  628. FallingDown = 7;
  629. Landing = 8;
  630. Splash = 9;
  631. }
  632.  
  633. local useUpdatedLocalSoundFlag = UserSettings():IsUserFeatureEnabled("UserFixCharacterSoundIssues")
  634.  
  635. local Humanoid = nil
  636. local Head = nil
  637. --SFX ID to Sound object
  638. local Sounds = {}
  639. local SoundService = game:GetService("SoundService")
  640. local soundEventFolderName = "DefaultSoundEvents"
  641. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  642. local AddCharacterLoadedEvent = nil
  643. local RemoveCharacterEvent = nil
  644. local soundEventFolder = ReplicatedStorage:FindFirstChild(soundEventFolderName)
  645. local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
  646.  
  647. if useSoundDispatcher then
  648. if not soundEventFolder then
  649. soundEventFolder = Instance.new("Folder", ReplicatedStorage)
  650. soundEventFolder.Name = soundEventFolderName
  651. soundEventFolder.Archivable = false
  652. end
  653.  
  654. -- Load the RemoveCharacterEvent
  655. RemoveCharacterEvent = soundEventFolder:FindFirstChild("RemoveCharacterEvent")
  656. if RemoveCharacterEvent == nil then
  657. RemoveCharacterEvent = Instance.new("RemoteEvent", soundEventFolder)
  658. RemoveCharacterEvent.Name = "RemoveCharacterEvent"
  659. end
  660.  
  661. AddCharacterLoadedEvent = soundEventFolder:FindFirstChild("AddCharacterLoadedEvent")
  662. if AddCharacterLoadedEvent == nil then
  663. AddCharacterLoadedEvent = Instance.new("RemoteEvent", soundEventFolder)
  664. AddCharacterLoadedEvent.Name = "AddCharacterLoadedEvent"
  665. end
  666.  
  667. -- Notify the server a new character has been loaded
  668. AddCharacterLoadedEvent:FireServer()
  669.  
  670. -- Notify the sound dispatcher this character has left.
  671. game.Players.LocalPlayer.CharacterRemoving:connect(function(character)
  672. RemoveCharacterEvent:FireServer(game.Players.LocalPlayer)
  673. end)
  674. end
  675.  
  676. do
  677. local Figure = script.Parent.Parent
  678. Head = Figure:WaitForChild("Head")
  679. while not Humanoid do
  680. for _,NewHumanoid in pairs(Figure:GetChildren()) do
  681. if NewHumanoid:IsA("Humanoid") then
  682. Humanoid = NewHumanoid
  683. break
  684. end
  685. end
  686. if Humanoid then break end
  687. Figure.ChildAdded:wait()
  688. end
  689. Sounds[SFX.Died] = Head:WaitForChild("Died")
  690. Sounds[SFX.Running] = Head:WaitForChild("Running")
  691. Sounds[SFX.Swimming] = Head:WaitForChild("Swimming")
  692. Sounds[SFX.Climbing] = Head:WaitForChild("Climbing")
  693. Sounds[SFX.Jumping] = Head:WaitForChild("Jumping")
  694. Sounds[SFX.GettingUp] = Head:WaitForChild("GettingUp")
  695. Sounds[SFX.FreeFalling] = Head:WaitForChild("FreeFalling")
  696. Sounds[SFX.Landing] = Head:WaitForChild("Landing")
  697. Sounds[SFX.Splash] = Head:WaitForChild("Splash")
  698.  
  699. local DefaultServerSoundEvent = nil
  700. if useSoundDispatcher then
  701. DefaultServerSoundEvent = soundEventFolder:FindFirstChild("DefaultServerSoundEvent")
  702. else
  703. DefaultServerSoundEvent = game:GetService("ReplicatedStorage"):FindFirstChild("DefaultServerSoundEvent")
  704. end
  705.  
  706. if DefaultServerSoundEvent then
  707. DefaultServerSoundEvent.OnClientEvent:connect(function(sound, playing, resetPosition)
  708. if resetPosition and sound.TimePosition ~= 0 then
  709. sound.TimePosition = 0
  710. end
  711. if sound.IsPlaying ~= playing then
  712. sound.Playing = playing
  713. end
  714. end)
  715. end
  716. end
  717.  
  718. local IsSoundFilteringEnabled = function()
  719. return game.Workspace.FilteringEnabled and SoundService.RespectFilteringEnabled
  720. end
  721.  
  722. local Util
  723. Util = {
  724.  
  725. --Define linear relationship between (pt1x,pt2x) and (pt2x,pt2y). Evaluate this at x.
  726. YForLineGivenXAndTwoPts = function(x,pt1x,pt1y,pt2x,pt2y)
  727. --(y - y1)/(x - x1) = m
  728. local m = (pt1y - pt2y) / (pt1x - pt2x)
  729. --float b = pt1.y - m * pt1.x;
  730. local b = (pt1y - m * pt1x)
  731. return m * x + b
  732. end;
  733.  
  734. --Clamps the value of "val" between the "min" and "max"
  735. Clamp = function(val,min,max)
  736. return math.min(max,math.max(min,val))
  737. end;
  738.  
  739. --Gets the horizontal (x,z) velocity magnitude of the given part
  740. HorizontalSpeed = function(Head)
  741. local hVel = Head.Velocity + Vector3.new(0,-Head.Velocity.Y,0)
  742. return hVel.magnitude
  743. end;
  744.  
  745. --Gets the vertical (y) velocity magnitude of the given part
  746. VerticalSpeed = function(Head)
  747. return math.abs(Head.Velocity.Y)
  748. end;
  749.  
  750. --Setting Playing/TimePosition values directly result in less network traffic than Play/Pause/Resume/Stop
  751. --If these properties are enabled, use them.
  752. Play = function(sound)
  753. if IsSoundFilteringEnabled() then
  754. sound.CharacterSoundEvent:FireServer(true, true)
  755. end
  756. if sound.TimePosition ~= 0 then
  757. sound.TimePosition = 0
  758. end
  759. if not sound.IsPlaying then
  760. sound.Playing = true
  761. end
  762. end;
  763.  
  764. Pause = function(sound)
  765. if IsSoundFilteringEnabled() then
  766. sound.CharacterSoundEvent:FireServer(false, false)
  767. end
  768. if sound.IsPlaying then
  769. sound.Playing = false
  770. end
  771. end;
  772.  
  773. Resume = function(sound)
  774. if IsSoundFilteringEnabled() then
  775. sound.CharacterSoundEvent:FireServer(true, false)
  776. end
  777. if not sound.IsPlaying then
  778. sound.Playing = true
  779. end
  780. end;
  781.  
  782. Stop = function(sound)
  783. if IsSoundFilteringEnabled() then
  784. sound.CharacterSoundEvent:FireServer(false, true)
  785. end
  786. if sound.IsPlaying then
  787. sound.Playing = false
  788. end
  789. if sound.TimePosition ~= 0 then
  790. sound.TimePosition = 0
  791. end
  792. end;
  793. }
  794.  
  795. do
  796. -- List of all active Looped sounds
  797. local playingLoopedSounds = {}
  798.  
  799. -- Last seen Enum.HumanoidStateType
  800. local activeState = nil
  801.  
  802. local fallSpeed = 0
  803.  
  804. -- Verify and set that "sound" is in "playingLoopedSounds".
  805. function setSoundInPlayingLoopedSounds(sound)
  806. for i=1, #playingLoopedSounds do
  807. if playingLoopedSounds[i] == sound then
  808. return
  809. end
  810. end
  811. table.insert(playingLoopedSounds,sound)
  812. end
  813.  
  814. -- Stop all active looped sounds except parameter "except". If "except" is not passed, all looped sounds will be stopped.
  815. function stopPlayingLoopedSoundsExcept(except)
  816. for i=#playingLoopedSounds,1,-1 do
  817. if playingLoopedSounds[i] ~= except then
  818. Util.Pause(playingLoopedSounds[i])
  819. table.remove(playingLoopedSounds,i)
  820. end
  821. end
  822. end
  823.  
  824. -- Table of Enum.HumanoidStateType to handling function
  825. local stateUpdateHandler = {
  826. [Enum.HumanoidStateType.Dead] = function()
  827. stopPlayingLoopedSoundsExcept()
  828. local sound = Sounds[SFX.Died]
  829. Util.Play(sound)
  830. end;
  831.  
  832. [Enum.HumanoidStateType.RunningNoPhysics] = function(speed)
  833. stateUpdated(Enum.HumanoidStateType.Running, speed)
  834. end;
  835.  
  836. [Enum.HumanoidStateType.Running] = function(speed)
  837. local sound = Sounds[SFX.Running]
  838. stopPlayingLoopedSoundsExcept(sound)
  839.  
  840. if(useUpdatedLocalSoundFlag and activeState == Enum.HumanoidStateType.Freefall and fallSpeed > 0.1) then
  841. -- Play a landing sound if the character dropped from a large distance
  842. local vol = math.min(1.0, math.max(0.0, (fallSpeed - 50) / 110))
  843. local freeFallSound = Sounds[SFX.FreeFalling]
  844. freeFallSound.Volume = vol
  845. Util.Play(freeFallSound)
  846. fallSpeed = 0
  847. end
  848. if useUpdatedLocalSoundFlag then
  849. if speed ~= nil and speed > 0.5 then
  850. Util.Resume(sound)
  851. setSoundInPlayingLoopedSounds(sound)
  852. elseif speed ~= nil then
  853. stopPlayingLoopedSoundsExcept()
  854. end
  855. else
  856. if Util.HorizontalSpeed(Head) > 0.5 then
  857. Util.Resume(sound)
  858. setSoundInPlayingLoopedSounds(sound)
  859. else
  860. stopPlayingLoopedSoundsExcept()
  861. end
  862. end
  863. end;
  864.  
  865. [Enum.HumanoidStateType.Swimming] = function(speed)
  866. local threshold
  867. if useUpdatedLocalSoundFlag then threshold = speed else threshold = Util.VerticalSpeed(Head) end
  868. if activeState ~= Enum.HumanoidStateType.Swimming and threshold > 0.1 then
  869. local splashSound = Sounds[SFX.Splash]
  870. splashSound.Volume = Util.Clamp(
  871. Util.YForLineGivenXAndTwoPts(
  872. Util.VerticalSpeed(Head),
  873. 100, 0.28,
  874. 350, 1),
  875. 0,1)
  876. Util.Play(splashSound)
  877. end
  878.  
  879. do
  880. local sound = Sounds[SFX.Swimming]
  881. stopPlayingLoopedSoundsExcept(sound)
  882. Util.Resume(sound)
  883. setSoundInPlayingLoopedSounds(sound)
  884. end
  885. end;
  886.  
  887. [Enum.HumanoidStateType.Climbing] = function(speed)
  888. local sound = Sounds[SFX.Climbing]
  889. if useUpdatedLocalSoundFlag then
  890. if speed ~= nil and math.abs(speed) > 0.1 then
  891. Util.Resume(sound)
  892. stopPlayingLoopedSoundsExcept(sound)
  893. else
  894. Util.Pause(sound)
  895. stopPlayingLoopedSoundsExcept(sound)
  896. end
  897. else
  898. if Util.VerticalSpeed(Head) > 0.1 then
  899. Util.Resume(sound)
  900. stopPlayingLoopedSoundsExcept(sound)
  901. else
  902. stopPlayingLoopedSoundsExcept()
  903. end
  904. end
  905.  
  906. setSoundInPlayingLoopedSounds(sound)
  907. end;
  908.  
  909. [Enum.HumanoidStateType.Jumping] = function()
  910. if activeState == Enum.HumanoidStateType.Jumping then
  911. return
  912. end
  913. stopPlayingLoopedSoundsExcept()
  914. local sound = Sounds[SFX.Jumping]
  915. Util.Play(sound)
  916. end;
  917.  
  918. [Enum.HumanoidStateType.GettingUp] = function()
  919. stopPlayingLoopedSoundsExcept()
  920. local sound = Sounds[SFX.GettingUp]
  921. Util.Play(sound)
  922. end;
  923.  
  924. [Enum.HumanoidStateType.Freefall] = function()
  925. if activeState == Enum.HumanoidStateType.Freefall then
  926. return
  927. end
  928. local sound = Sounds[SFX.FreeFalling]
  929. sound.Volume = 0
  930. stopPlayingLoopedSoundsExcept()
  931.  
  932. fallSpeed = math.max(fallSpeed, math.abs(Head.Velocity.y))
  933. end;
  934.  
  935. [Enum.HumanoidStateType.FallingDown] = function()
  936. stopPlayingLoopedSoundsExcept()
  937. end;
  938.  
  939. [Enum.HumanoidStateType.Landed] = function()
  940. stopPlayingLoopedSoundsExcept()
  941. if Util.VerticalSpeed(Head) > 75 then
  942. local landingSound = Sounds[SFX.Landing]
  943. landingSound.Volume = Util.Clamp(
  944. Util.YForLineGivenXAndTwoPts(
  945. Util.VerticalSpeed(Head),
  946. 50, 0,
  947. 100, 1),
  948. 0,1)
  949. Util.Play(landingSound)
  950. end
  951. end;
  952.  
  953. [Enum.HumanoidStateType.Seated] = function()
  954. stopPlayingLoopedSoundsExcept()
  955. end;
  956. }
  957.  
  958.  
  959.  
  960. -- Handle state event fired or OnChange fired
  961. function stateUpdated(state, speed)
  962. if stateUpdateHandler[state] ~= nil then
  963. if useUpdatedLocalSoundFlag and (state == Enum.HumanoidStateType.Running
  964. or state == Enum.HumanoidStateType.Climbing
  965. or state == Enum.HumanoidStateType.Swimming
  966. or state == Enum.HumanoidStateType.RunningNoPhysics) then
  967. stateUpdateHandler[state](speed)
  968. else
  969. stateUpdateHandler[state]()
  970. end
  971. end
  972. activeState = state
  973. end
  974.  
  975. Humanoid.Died:connect( function() stateUpdated(Enum.HumanoidStateType.Dead) end)
  976. Humanoid.Running:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Running, speed) end)
  977. Humanoid.Swimming:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Swimming, speed) end)
  978. Humanoid.Climbing:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Climbing, speed) end)
  979. Humanoid.Jumping:connect( function() stateUpdated(Enum.HumanoidStateType.Jumping) end)
  980. Humanoid.GettingUp:connect( function() stateUpdated(Enum.HumanoidStateType.GettingUp) end)
  981. Humanoid.FreeFalling:connect( function() stateUpdated(Enum.HumanoidStateType.Freefall) end)
  982. Humanoid.FallingDown:connect( function() stateUpdated(Enum.HumanoidStateType.FallingDown) end)
  983.  
  984.  
  985.  
  986. -- required for proper handling of Landed event
  987.  
  988. Humanoid.StateChanged:connect(function(old, new)
  989. stateUpdated(new)
  990. end)
  991.  
  992.  
  993.  
  994. function onUpdate(stepDeltaSeconds, tickSpeedSeconds)
  995. local stepScale = stepDeltaSeconds / tickSpeedSeconds
  996. do
  997. local sound = Sounds[SFX.FreeFalling]
  998. if activeState == Enum.HumanoidStateType.Freefall then
  999. if Head.Velocity.Y < 0 and Util.VerticalSpeed(Head) > 75 then
  1000. Util.Resume(sound)
  1001.  
  1002. --Volume takes 1.1 seconds to go from volume 0 to 1
  1003. local ANIMATION_LENGTH_SECONDS = 1.1
  1004.  
  1005. local normalizedIncrement = tickSpeedSeconds / ANIMATION_LENGTH_SECONDS
  1006. sound.Volume = Util.Clamp(sound.Volume + normalizedIncrement * stepScale, 0, 1)
  1007. else
  1008. sound.Volume = 0
  1009. end
  1010. else
  1011. Util.Pause(sound)
  1012. end
  1013. end
  1014.  
  1015. do
  1016. local sound = Sounds[SFX.Running]
  1017. if activeState == Enum.HumanoidStateType.Running then
  1018. if Util.HorizontalSpeed(Head) < 0.5 then
  1019. Util.Pause(sound)
  1020. end
  1021. end
  1022. end
  1023. end
  1024.  
  1025.  
  1026. local lastTick = tick()
  1027. local TICK_SPEED_SECONDS = 0.25
  1028. while true do
  1029. onUpdate(tick() - lastTick,TICK_SPEED_SECONDS)
  1030. lastTick = tick()
  1031. wait(TICK_SPEED_SECONDS)
  1032. end
  1033.  
  1034. end
  1035.  
  1036. end,o72)
  1037.  
  1038. o73.Name = "Health"
  1039. o73.Parent = o14
  1040.  
  1041. runDummyScript(function()
  1042. -- Gradually regenerates the Humanoid's Health over time.
  1043.  
  1044. local REGEN_RATE = 1/100 -- Regenerate this fraction of MaxHealth per second.
  1045. local REGEN_STEP = 1 -- Wait this long between each regeneration step.
  1046.  
  1047. --------------------------------------------------------------------------------
  1048.  
  1049. local Character = script.Parent
  1050. local Humanoid = Character:WaitForChild'Humanoid'
  1051.  
  1052. --------------------------------------------------------------------------------
  1053.  
  1054. while true do
  1055. while Humanoid.Health < Humanoid.MaxHealth do
  1056. local dt = wait(REGEN_STEP)
  1057. local dh = dt*REGEN_RATE*Humanoid.MaxHealth
  1058. Humanoid.Health = math.min(Humanoid.Health + dh, Humanoid.MaxHealth)
  1059. end
  1060. Humanoid.HealthChanged:Wait()
  1061. end
  1062. end,o73)
  1063.  
  1064. o74.Name = "Animate"
  1065. o74.Parent = o14
  1066.  
  1067. runDummyScript(function()
  1068. local Figure = script.Parent
  1069. local Torso = Figure:WaitForChild("Torso")
  1070. local RightShoulder = Torso:WaitForChild("Right Shoulder")
  1071. local LeftShoulder = Torso:WaitForChild("Left Shoulder")
  1072. local RightHip = Torso:WaitForChild("Right Hip")
  1073. local LeftHip = Torso:WaitForChild("Left Hip")
  1074. local Neck = Torso:WaitForChild("Neck")
  1075. local Humanoid = Figure:WaitForChild("Humanoid")
  1076. local pose = "Standing"
  1077.  
  1078. local currentAnim = ""
  1079. local currentAnimInstance = nil
  1080. local currentAnimTrack = nil
  1081. local currentAnimKeyframeHandler = nil
  1082. local currentAnimSpeed = 1.0
  1083. local animTable = {}
  1084. local animNames = {
  1085. idle = {
  1086. { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  1087. { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  1088. },
  1089. walk = {
  1090. { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  1091. },
  1092. run = {
  1093. { id = "run.xml", weight = 10 }
  1094. },
  1095. jump = {
  1096. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  1097. },
  1098. fall = {
  1099. { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  1100. },
  1101. climb = {
  1102. { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  1103. },
  1104. sit = {
  1105. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  1106. },
  1107. toolnone = {
  1108. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  1109. },
  1110. toolslash = {
  1111. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  1112. -- { id = "slash.xml", weight = 10 }
  1113. },
  1114. toollunge = {
  1115. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  1116. },
  1117. wave = {
  1118. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  1119. },
  1120. point = {
  1121. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  1122. },
  1123. dance1 = {
  1124. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  1125. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  1126. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  1127. },
  1128. dance2 = {
  1129. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  1130. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  1131. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  1132. },
  1133. dance3 = {
  1134. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  1135. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  1136. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  1137. },
  1138. laugh = {
  1139. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  1140. },
  1141. cheer = {
  1142. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  1143. },
  1144. }
  1145. local dances = {"dance1", "dance2", "dance3"}
  1146.  
  1147. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  1148. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  1149.  
  1150. function configureAnimationSet(name, fileList)
  1151. if (animTable[name] ~= nil) then
  1152. for _, connection in pairs(animTable[name].connections) do
  1153. connection:disconnect()
  1154. end
  1155. end
  1156. animTable[name] = {}
  1157. animTable[name].count = 0
  1158. animTable[name].totalWeight = 0
  1159. animTable[name].connections = {}
  1160.  
  1161. -- check for config values
  1162. local config = script:FindFirstChild(name)
  1163. if (config ~= nil) then
  1164. -- print("Loading anims " .. name)
  1165. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  1166. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  1167. local idx = 1
  1168. for _, childPart in pairs(config:GetChildren()) do
  1169. if (childPart:IsA("Animation")) then
  1170. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  1171. animTable[name][idx] = {}
  1172. animTable[name][idx].anim = childPart
  1173. local weightObject = childPart:FindFirstChild("Weight")
  1174. if (weightObject == nil) then
  1175. animTable[name][idx].weight = 1
  1176. else
  1177. animTable[name][idx].weight = weightObject.Value
  1178. end
  1179. animTable[name].count = animTable[name].count + 1
  1180. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  1181. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  1182. idx = idx + 1
  1183. end
  1184. end
  1185. end
  1186.  
  1187. -- fallback to defaults
  1188. if (animTable[name].count <= 0) then
  1189. for idx, anim in pairs(fileList) do
  1190. animTable[name][idx] = {}
  1191. animTable[name][idx].anim = Instance.new("Animation")
  1192. animTable[name][idx].anim.Name = name
  1193. animTable[name][idx].anim.AnimationId = anim.id
  1194. animTable[name][idx].weight = anim.weight
  1195. animTable[name].count = animTable[name].count + 1
  1196. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  1197. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  1198. end
  1199. end
  1200. end
  1201.  
  1202. -- Setup animation objects
  1203. function scriptChildModified(child)
  1204. local fileList = animNames[child.Name]
  1205. if (fileList ~= nil) then
  1206. configureAnimationSet(child.Name, fileList)
  1207. end
  1208. end
  1209.  
  1210. script.ChildAdded:connect(scriptChildModified)
  1211. script.ChildRemoved:connect(scriptChildModified)
  1212.  
  1213.  
  1214. for name, fileList in pairs(animNames) do
  1215. configureAnimationSet(name, fileList)
  1216. end
  1217.  
  1218. -- ANIMATION
  1219.  
  1220. -- declarations
  1221. local toolAnim = "None"
  1222. local toolAnimTime = 0
  1223.  
  1224. local jumpAnimTime = 0
  1225. local jumpAnimDuration = 0.3
  1226.  
  1227. local toolTransitionTime = 0.1
  1228. local fallTransitionTime = 0.3
  1229. local jumpMaxLimbVelocity = 0.75
  1230.  
  1231. -- functions
  1232.  
  1233. function stopAllAnimations()
  1234. local oldAnim = currentAnim
  1235.  
  1236. -- return to idle if finishing an emote
  1237. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  1238. oldAnim = "idle"
  1239. end
  1240.  
  1241. currentAnim = ""
  1242. currentAnimInstance = nil
  1243. if (currentAnimKeyframeHandler ~= nil) then
  1244. currentAnimKeyframeHandler:disconnect()
  1245. end
  1246.  
  1247. if (currentAnimTrack ~= nil) then
  1248. currentAnimTrack:Stop()
  1249. currentAnimTrack:Destroy()
  1250. currentAnimTrack = nil
  1251. end
  1252. return oldAnim
  1253. end
  1254.  
  1255. function setAnimationSpeed(speed)
  1256. if speed ~= currentAnimSpeed then
  1257. currentAnimSpeed = speed
  1258. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  1259. end
  1260. end
  1261.  
  1262. function keyFrameReachedFunc(frameName)
  1263. if (frameName == "End") then
  1264.  
  1265. local repeatAnim = currentAnim
  1266. -- return to idle if finishing an emote
  1267. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  1268. repeatAnim = "idle"
  1269. end
  1270.  
  1271. local animSpeed = currentAnimSpeed
  1272. playAnimation(repeatAnim, 0.0, Humanoid)
  1273. setAnimationSpeed(animSpeed)
  1274. end
  1275. end
  1276.  
  1277. -- Preload animations
  1278. function playAnimation(animName, transitionTime, humanoid)
  1279.  
  1280. local roll = math.random(1, animTable[animName].totalWeight)
  1281. local origRoll = roll
  1282. local idx = 1
  1283. while (roll > animTable[animName][idx].weight) do
  1284. roll = roll - animTable[animName][idx].weight
  1285. idx = idx + 1
  1286. end
  1287. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  1288. local anim = animTable[animName][idx].anim
  1289.  
  1290. -- switch animation
  1291. if (anim ~= currentAnimInstance) then
  1292.  
  1293. if (currentAnimTrack ~= nil) then
  1294. currentAnimTrack:Stop(transitionTime)
  1295. currentAnimTrack:Destroy()
  1296. end
  1297.  
  1298. currentAnimSpeed = 1.0
  1299.  
  1300. -- load it to the humanoid; get AnimationTrack
  1301. currentAnimTrack = humanoid:LoadAnimation(anim)
  1302. currentAnimTrack.Priority = Enum.AnimationPriority.Core
  1303.  
  1304. -- play the animation
  1305. currentAnimTrack:Play(transitionTime)
  1306. currentAnim = animName
  1307. currentAnimInstance = anim
  1308.  
  1309. -- set up keyframe name triggers
  1310. if (currentAnimKeyframeHandler ~= nil) then
  1311. currentAnimKeyframeHandler:disconnect()
  1312. end
  1313. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  1314.  
  1315. end
  1316.  
  1317. end
  1318.  
  1319. -------------------------------------------------------------------------------------------
  1320. -------------------------------------------------------------------------------------------
  1321.  
  1322. local toolAnimName = ""
  1323. local toolAnimTrack = nil
  1324. local toolAnimInstance = nil
  1325. local currentToolAnimKeyframeHandler = nil
  1326.  
  1327. function toolKeyFrameReachedFunc(frameName)
  1328. if (frameName == "End") then
  1329. -- print("Keyframe : ".. frameName)
  1330. playToolAnimation(toolAnimName, 0.0, Humanoid)
  1331. end
  1332. end
  1333.  
  1334.  
  1335. function playToolAnimation(animName, transitionTime, humanoid, priority)
  1336.  
  1337. local roll = math.random(1, animTable[animName].totalWeight)
  1338. local origRoll = roll
  1339. local idx = 1
  1340. while (roll > animTable[animName][idx].weight) do
  1341. roll = roll - animTable[animName][idx].weight
  1342. idx = idx + 1
  1343. end
  1344. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  1345. local anim = animTable[animName][idx].anim
  1346.  
  1347. if (toolAnimInstance ~= anim) then
  1348.  
  1349. if (toolAnimTrack ~= nil) then
  1350. toolAnimTrack:Stop()
  1351. toolAnimTrack:Destroy()
  1352. transitionTime = 0
  1353. end
  1354.  
  1355. -- load it to the humanoid; get AnimationTrack
  1356. toolAnimTrack = humanoid:LoadAnimation(anim)
  1357. if priority then
  1358. toolAnimTrack.Priority = priority
  1359. end
  1360.  
  1361. -- play the animation
  1362. toolAnimTrack:Play(transitionTime)
  1363. toolAnimName = animName
  1364. toolAnimInstance = anim
  1365.  
  1366. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  1367. end
  1368. end
  1369.  
  1370. function stopToolAnimations()
  1371. local oldAnim = toolAnimName
  1372.  
  1373. if (currentToolAnimKeyframeHandler ~= nil) then
  1374. currentToolAnimKeyframeHandler:disconnect()
  1375. end
  1376.  
  1377. toolAnimName = ""
  1378. toolAnimInstance = nil
  1379. if (toolAnimTrack ~= nil) then
  1380. toolAnimTrack:Stop()
  1381. toolAnimTrack:Destroy()
  1382. toolAnimTrack = nil
  1383. end
  1384.  
  1385.  
  1386. return oldAnim
  1387. end
  1388.  
  1389. -------------------------------------------------------------------------------------------
  1390. -------------------------------------------------------------------------------------------
  1391.  
  1392.  
  1393. function onRunning(speed)
  1394. if speed > 0.01 then
  1395. playAnimation("walk", 0.1, Humanoid)
  1396. if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  1397. setAnimationSpeed(speed / 14.5)
  1398. end
  1399. pose = "Running"
  1400. else
  1401. if emoteNames[currentAnim] == nil then
  1402. playAnimation("idle", 0.1, Humanoid)
  1403. pose = "Standing"
  1404. end
  1405. end
  1406. end
  1407.  
  1408. function onDied()
  1409. pose = "Dead"
  1410. end
  1411.  
  1412. function onJumping()
  1413. playAnimation("jump", 0.1, Humanoid)
  1414. jumpAnimTime = jumpAnimDuration
  1415. pose = "Jumping"
  1416. end
  1417.  
  1418. function onClimbing(speed)
  1419. playAnimation("climb", 0.1, Humanoid)
  1420. setAnimationSpeed(speed / 12.0)
  1421. pose = "Climbing"
  1422. end
  1423.  
  1424. function onGettingUp()
  1425. pose = "GettingUp"
  1426. end
  1427.  
  1428. function onFreeFall()
  1429. if (jumpAnimTime <= 0) then
  1430. playAnimation("fall", fallTransitionTime, Humanoid)
  1431. end
  1432. pose = "FreeFall"
  1433. end
  1434.  
  1435. function onFallingDown()
  1436. pose = "FallingDown"
  1437. end
  1438.  
  1439. function onSeated()
  1440. pose = "Seated"
  1441. end
  1442.  
  1443. function onPlatformStanding()
  1444. pose = "PlatformStanding"
  1445. end
  1446.  
  1447. function onSwimming(speed)
  1448. if speed > 0 then
  1449. pose = "Running"
  1450. else
  1451. pose = "Standing"
  1452. end
  1453. end
  1454.  
  1455. function getTool()
  1456. for _, kid in ipairs(Figure:GetChildren()) do
  1457. if kid.className == "Tool" then return kid end
  1458. end
  1459. return nil
  1460. end
  1461.  
  1462. function getToolAnim(tool)
  1463. for _, c in ipairs(tool:GetChildren()) do
  1464. if c.Name == "toolanim" and c.className == "StringValue" then
  1465. return c
  1466. end
  1467. end
  1468. return nil
  1469. end
  1470.  
  1471. function animateTool()
  1472.  
  1473. if (toolAnim == "None") then
  1474. playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
  1475. return
  1476. end
  1477.  
  1478. if (toolAnim == "Slash") then
  1479. playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
  1480. return
  1481. end
  1482.  
  1483. if (toolAnim == "Lunge") then
  1484. playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
  1485. return
  1486. end
  1487. end
  1488.  
  1489. function moveSit()
  1490. RightShoulder.MaxVelocity = 0.15
  1491. LeftShoulder.MaxVelocity = 0.15
  1492. RightShoulder:SetDesiredAngle(3.14 /2)
  1493. LeftShoulder:SetDesiredAngle(-3.14 /2)
  1494. RightHip:SetDesiredAngle(3.14 /2)
  1495. LeftHip:SetDesiredAngle(-3.14 /2)
  1496. end
  1497.  
  1498. local lastTick = 0
  1499.  
  1500. function move(time)
  1501. local amplitude = 1
  1502. local frequency = 1
  1503. local deltaTime = time - lastTick
  1504. lastTick = time
  1505.  
  1506. local climbFudge = 0
  1507. local setAngles = false
  1508.  
  1509. if (jumpAnimTime > 0) then
  1510. jumpAnimTime = jumpAnimTime - deltaTime
  1511. end
  1512.  
  1513. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1514. playAnimation("fall", fallTransitionTime, Humanoid)
  1515. elseif (pose == "Seated") then
  1516. playAnimation("sit", 0.5, Humanoid)
  1517. return
  1518. elseif (pose == "Running") then
  1519. playAnimation("walk", 0.1, Humanoid)
  1520. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1521. -- print("Wha " .. pose)
  1522. stopAllAnimations()
  1523. amplitude = 0.1
  1524. frequency = 1
  1525. setAngles = true
  1526. end
  1527.  
  1528. if (setAngles) then
  1529. local desiredAngle = amplitude * math.sin(time * frequency)
  1530.  
  1531. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  1532. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  1533. RightHip:SetDesiredAngle(-desiredAngle)
  1534. LeftHip:SetDesiredAngle(-desiredAngle)
  1535. end
  1536.  
  1537. -- Tool Animation handling
  1538. local tool = getTool()
  1539. if tool and tool:FindFirstChild("Handle") then
  1540.  
  1541. local animStringValueObject = getToolAnim(tool)
  1542.  
  1543. if animStringValueObject then
  1544. toolAnim = animStringValueObject.Value
  1545. -- message recieved, delete StringValue
  1546. animStringValueObject.Parent = nil
  1547. toolAnimTime = time + .3
  1548. end
  1549.  
  1550. if time > toolAnimTime then
  1551. toolAnimTime = 0
  1552. toolAnim = "None"
  1553. end
  1554.  
  1555. animateTool()
  1556. else
  1557. stopToolAnimations()
  1558. toolAnim = "None"
  1559. toolAnimInstance = nil
  1560. toolAnimTime = 0
  1561. end
  1562. end
  1563.  
  1564. -- connect events
  1565. Humanoid.Died:connect(onDied)
  1566. Humanoid.Running:connect(onRunning)
  1567. Humanoid.Jumping:connect(onJumping)
  1568. Humanoid.Climbing:connect(onClimbing)
  1569. Humanoid.GettingUp:connect(onGettingUp)
  1570. Humanoid.FreeFalling:connect(onFreeFall)
  1571. Humanoid.FallingDown:connect(onFallingDown)
  1572. Humanoid.Seated:connect(onSeated)
  1573. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1574. Humanoid.Swimming:connect(onSwimming)
  1575.  
  1576. -- setup emote chat hook
  1577. game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
  1578. local emote = ""
  1579. if msg == "/e dance" then
  1580. emote = dances[math.random(1, #dances)]
  1581. elseif (string.sub(msg, 1, 3) == "/e ") then
  1582. emote = string.sub(msg, 4)
  1583. elseif (string.sub(msg, 1, 7) == "/emote ") then
  1584. emote = string.sub(msg, 8)
  1585. end
  1586.  
  1587. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  1588. playAnimation(emote, 0.1, Humanoid)
  1589. end
  1590.  
  1591. end)
  1592.  
  1593.  
  1594. -- main program
  1595.  
  1596. -- initialize to idle
  1597. playAnimation("idle", 0.1, Humanoid)
  1598. pose = "Standing"
  1599.  
  1600. while Figure.Parent ~= nil do
  1601. local _, time = wait(0.1)
  1602. move(time)
  1603. end
  1604.  
  1605.  
  1606.  
  1607. end,o74)
  1608.  
  1609. o75.Name = "idle"
  1610. o75.Parent = o74
  1611. o76.Name = "Animation1"
  1612. o76.Parent = o75
  1613. o76.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  1614. o77.Name = "Weight"
  1615. o77.Parent = o76
  1616. o77.Value = 9
  1617. o78.Name = "Animation2"
  1618. o78.Parent = o75
  1619. o78.AnimationId = "http://www.roblox.com/asset/?id=180435792"
  1620. o79.Name = "Weight"
  1621. o79.Parent = o78
  1622. o79.Value = 1
  1623. o80.Name = "walk"
  1624. o80.Parent = o74
  1625. o81.Name = "WalkAnim"
  1626. o81.Parent = o80
  1627. o81.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1628. o82.Name = "run"
  1629. o82.Parent = o74
  1630. o83.Name = "RunAnim"
  1631. o83.Parent = o82
  1632. o83.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1633. o84.Name = "jump"
  1634. o84.Parent = o74
  1635. o85.Name = "JumpAnim"
  1636. o85.Parent = o84
  1637. o85.AnimationId = "http://www.roblox.com/asset/?id=125750702"
  1638. o86.Name = "climb"
  1639. o86.Parent = o74
  1640. o87.Name = "ClimbAnim"
  1641. o87.Parent = o86
  1642. o87.AnimationId = "http://www.roblox.com/asset/?id=180436334"
  1643. o88.Name = "toolnone"
  1644. o88.Parent = o74
  1645. o89.Name = "ToolNoneAnim"
  1646. o89.Parent = o88
  1647. o89.AnimationId = "http://www.roblox.com/asset/?id=182393478"
  1648. o90.Name = "fall"
  1649. o90.Parent = o74
  1650. o91.Name = "FallAnim"
  1651. o91.Parent = o90
  1652. o91.AnimationId = "http://www.roblox.com/asset/?id=180436148"
  1653. o92.Name = "sit"
  1654. o92.Parent = o74
  1655. o93.Name = "SitAnim"
  1656. o93.Parent = o92
  1657. o93.AnimationId = "http://www.roblox.com/asset/?id=178130996"
  1658. o94.Name = "ScaleDampeningPercent"
  1659. o94.Parent = o74
  1660. o94.Value = 0.39999997615814
  1661. o95.Parent = o14
  1662. o95.HeadColor = BrickColor.new("Pastel brown")
  1663. o95.LeftArmColor = BrickColor.new("Pastel brown")
  1664. o95.LeftLegColor = BrickColor.new("Pastel brown")
  1665. o95.RightArmColor = BrickColor.new("Pastel brown")
  1666. o95.RightLegColor = BrickColor.new("Pastel brown")
  1667. o95.TorsoColor = BrickColor.new("Pastel brown")
  1668. o96.Name = "Pants"
  1669. o96.Parent = o14
  1670. o96.PantsTemplate = "http://www.roblox.com/asset/?id=1439542143"
  1671. o98.Name = "Handle"
  1672. o98.Parent = mas
  1673. o98.Position = Vector3.new(-24.0806046, 6.87327433, 40.703331)
  1674. o98.Rotation = Vector3.new(-0.239999995, -34.9300003, -0.140000001)
  1675. o98.CanCollide = false
  1676. o98.Locked = true
  1677. o98.FormFactor = Enum.FormFactor.Custom
  1678. o98.Size = Vector3.new(1.45002651, 2.35999823, 1.24000001)
  1679. o98.CFrame = CFrame.new(-24.0806046, 6.87327433, 40.703331, 0.81987673, 0.00198863354, -0.572536647, -1.19155866e-05, 0.99999404, 0.00345628988, 0.572540045, -0.00282691, 0.819871843)
  1680. o98.BottomSurface = Enum.SurfaceType.Smooth
  1681. o98.TopSurface = Enum.SurfaceType.Smooth
  1682. o98.Position = Vector3.new(-24.0806046, 6.87327433, 40.703331)
  1683. o99.Parent = o98
  1684. o99.MeshId = "http://www.roblox.com/asset/?id=188565062 "
  1685. o99.TextureId = "http://www.roblox.com/asset/?id=188565095 "
  1686. o99.MeshType = Enum.MeshType.FileMesh
  1687. o101.Name = "OriginalSize"
  1688. o101.Parent = o98
  1689. o101.Value = Vector3.new(1.45002651, 2.35999823, 1.24000001)
  1690. o102.Name = "AccessoryWeld"
  1691. o102.Parent = o98
  1692. o102.C0 = CFrame.new(8.65748007e-09, 0.199999809, -0.0252722446, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1693. o102.C1 = CFrame.new(0, 0.600000024, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1694. o102.Part0 = o98
  1695. o102.Part1 = o15
  1696. o103.Name = "Shirt"
  1697. o103.Parent = o14
  1698. o103.ShirtTemplate = "http://www.roblox.com/asset/?id=1439532842"
  1699. mas.Parent = workspace
  1700. mas:MakeJoints()
  1701. local mas1 = mas:GetChildren()
  1702. for i=1,#mas1 do
  1703. mas1[i].Parent = workspace
  1704. ypcall(function() mas1[i]:MakeJoints() end)
  1705. end
  1706. mas:Destroy()
  1707. for i=1,#cors do
  1708. coroutine.resume(cors[i])
  1709. end
  1710. mess_handle.Text = "Resetting"
  1711. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  1712. v:LoadCharacter()
  1713. end
  1714. wait(1)
  1715. mess_handle:Remove()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement