hawoody

Reset4852258 and Crystal5241

Apr 20th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 110.29 KB | None | 0 0
  1. --Converted with ttyyuu12345's model to script plugin v4
  2. function sandbox(var,func)
  3. local env = getfenv(func)
  4. local newenv = setmetatable({},{
  5. __index = function(self,k)
  6. if k=="script" then
  7. return var
  8. else
  9. return env[k]
  10. end
  11. end,
  12. })
  13. setfenv(func,newenv)
  14. return func
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. Model0 = Instance.new("Model")
  19. Part1 = Instance.new("Part")
  20. Sound2 = Instance.new("Sound")
  21. RemoteEvent3 = Instance.new("RemoteEvent")
  22. Sound4 = Instance.new("Sound")
  23. RemoteEvent5 = Instance.new("RemoteEvent")
  24. Sound6 = Instance.new("Sound")
  25. RemoteEvent7 = Instance.new("RemoteEvent")
  26. Sound8 = Instance.new("Sound")
  27. RemoteEvent9 = Instance.new("RemoteEvent")
  28. Sound10 = Instance.new("Sound")
  29. RemoteEvent11 = Instance.new("RemoteEvent")
  30. Sound12 = Instance.new("Sound")
  31. RemoteEvent13 = Instance.new("RemoteEvent")
  32. Sound14 = Instance.new("Sound")
  33. RemoteEvent15 = Instance.new("RemoteEvent")
  34. Sound16 = Instance.new("Sound")
  35. RemoteEvent17 = Instance.new("RemoteEvent")
  36. Sound18 = Instance.new("Sound")
  37. RemoteEvent19 = Instance.new("RemoteEvent")
  38. SpecialMesh20 = Instance.new("SpecialMesh")
  39. Decal21 = Instance.new("Decal")
  40. Part22 = Instance.new("Part")
  41. Decal23 = Instance.new("Decal")
  42. Part24 = Instance.new("Part")
  43. Part25 = Instance.new("Part")
  44. Part26 = Instance.new("Part")
  45. Part27 = Instance.new("Part")
  46. Humanoid28 = Instance.new("Humanoid")
  47. Part29 = Instance.new("Part")
  48. Motor6D30 = Instance.new("Motor6D")
  49. Script31 = Instance.new("Script")
  50. LocalScript32 = Instance.new("LocalScript")
  51. Script33 = Instance.new("Script")
  52. LocalScript34 = Instance.new("LocalScript")
  53. StringValue35 = Instance.new("StringValue")
  54. Animation36 = Instance.new("Animation")
  55. NumberValue37 = Instance.new("NumberValue")
  56. Animation38 = Instance.new("Animation")
  57. NumberValue39 = Instance.new("NumberValue")
  58. StringValue40 = Instance.new("StringValue")
  59. Animation41 = Instance.new("Animation")
  60. StringValue42 = Instance.new("StringValue")
  61. Animation43 = Instance.new("Animation")
  62. StringValue44 = Instance.new("StringValue")
  63. Animation45 = Instance.new("Animation")
  64. StringValue46 = Instance.new("StringValue")
  65. Animation47 = Instance.new("Animation")
  66. StringValue48 = Instance.new("StringValue")
  67. Animation49 = Instance.new("Animation")
  68. StringValue50 = Instance.new("StringValue")
  69. Animation51 = Instance.new("Animation")
  70. StringValue52 = Instance.new("StringValue")
  71. Animation53 = Instance.new("Animation")
  72. Pants54 = Instance.new("Pants")
  73. Accessory55 = Instance.new("Accessory")
  74. Part56 = Instance.new("Part")
  75. SpecialMesh57 = Instance.new("SpecialMesh")
  76. CharacterMesh58 = Instance.new("CharacterMesh")
  77. Accessory59 = Instance.new("Accessory")
  78. Part60 = Instance.new("Part")
  79. SpecialMesh61 = Instance.new("SpecialMesh")
  80. Vector3Value62 = Instance.new("Vector3Value")
  81. Accessory63 = Instance.new("Accessory")
  82. Part64 = Instance.new("Part")
  83. SpecialMesh65 = Instance.new("SpecialMesh")
  84. Vector3Value66 = Instance.new("Vector3Value")
  85. CharacterMesh67 = Instance.new("CharacterMesh")
  86. Accessory68 = Instance.new("Accessory")
  87. Part69 = Instance.new("Part")
  88. SpecialMesh70 = Instance.new("SpecialMesh")
  89. Vector3Value71 = Instance.new("Vector3Value")
  90. CharacterMesh72 = Instance.new("CharacterMesh")
  91. CharacterMesh73 = Instance.new("CharacterMesh")
  92. CharacterMesh74 = Instance.new("CharacterMesh")
  93. Shirt75 = Instance.new("Shirt")
  94. Accessory76 = Instance.new("Accessory")
  95. Part77 = Instance.new("Part")
  96. SpecialMesh78 = Instance.new("SpecialMesh")
  97. Vector3Value79 = Instance.new("Vector3Value")
  98. Model80 = Instance.new("Model")
  99. Part81 = Instance.new("Part")
  100. SpecialMesh82 = Instance.new("SpecialMesh")
  101. Part83 = Instance.new("Part")
  102. Part84 = Instance.new("Part")
  103. Part85 = Instance.new("Part")
  104. Part86 = Instance.new("Part")
  105. Part87 = Instance.new("Part")
  106. Part88 = Instance.new("Part")
  107. Part89 = Instance.new("Part")
  108. Part90 = Instance.new("Part")
  109. Part91 = Instance.new("Part")
  110. Part92 = Instance.new("Part")
  111. Part93 = Instance.new("Part")
  112. Part94 = Instance.new("Part")
  113. Part95 = Instance.new("Part")
  114. Part96 = Instance.new("Part")
  115. Part97 = Instance.new("Part")
  116. Model98 = Instance.new("Model")
  117. Part99 = Instance.new("Part")
  118. SpecialMesh100 = Instance.new("SpecialMesh")
  119. Sound101 = Instance.new("Sound")
  120. RemoteEvent102 = Instance.new("RemoteEvent")
  121. Sound103 = Instance.new("Sound")
  122. RemoteEvent104 = Instance.new("RemoteEvent")
  123. Sound105 = Instance.new("Sound")
  124. RemoteEvent106 = Instance.new("RemoteEvent")
  125. Sound107 = Instance.new("Sound")
  126. RemoteEvent108 = Instance.new("RemoteEvent")
  127. Sound109 = Instance.new("Sound")
  128. RemoteEvent110 = Instance.new("RemoteEvent")
  129. Sound111 = Instance.new("Sound")
  130. RemoteEvent112 = Instance.new("RemoteEvent")
  131. Sound113 = Instance.new("Sound")
  132. RemoteEvent114 = Instance.new("RemoteEvent")
  133. Sound115 = Instance.new("Sound")
  134. RemoteEvent116 = Instance.new("RemoteEvent")
  135. Sound117 = Instance.new("Sound")
  136. RemoteEvent118 = Instance.new("RemoteEvent")
  137. Decal119 = Instance.new("Decal")
  138. Part120 = Instance.new("Part")
  139. Decal121 = Instance.new("Decal")
  140. Part122 = Instance.new("Part")
  141. Part123 = Instance.new("Part")
  142. Part124 = Instance.new("Part")
  143. Part125 = Instance.new("Part")
  144. Humanoid126 = Instance.new("Humanoid")
  145. Part127 = Instance.new("Part")
  146. Motor6D128 = Instance.new("Motor6D")
  147. Script129 = Instance.new("Script")
  148. LocalScript130 = Instance.new("LocalScript")
  149. Script131 = Instance.new("Script")
  150. LocalScript132 = Instance.new("LocalScript")
  151. StringValue133 = Instance.new("StringValue")
  152. Animation134 = Instance.new("Animation")
  153. NumberValue135 = Instance.new("NumberValue")
  154. Animation136 = Instance.new("Animation")
  155. NumberValue137 = Instance.new("NumberValue")
  156. StringValue138 = Instance.new("StringValue")
  157. Animation139 = Instance.new("Animation")
  158. StringValue140 = Instance.new("StringValue")
  159. Animation141 = Instance.new("Animation")
  160. StringValue142 = Instance.new("StringValue")
  161. Animation143 = Instance.new("Animation")
  162. StringValue144 = Instance.new("StringValue")
  163. Animation145 = Instance.new("Animation")
  164. StringValue146 = Instance.new("StringValue")
  165. Animation147 = Instance.new("Animation")
  166. StringValue148 = Instance.new("StringValue")
  167. Animation149 = Instance.new("Animation")
  168. StringValue150 = Instance.new("StringValue")
  169. Animation151 = Instance.new("Animation")
  170. Shirt152 = Instance.new("Shirt")
  171. Accessory153 = Instance.new("Accessory")
  172. Part154 = Instance.new("Part")
  173. SpecialMesh155 = Instance.new("SpecialMesh")
  174. Vector3Value156 = Instance.new("Vector3Value")
  175. Pants157 = Instance.new("Pants")
  176. Model0.Name = "Crystal5241"
  177. Model0.Parent = mas
  178. Model0.PrimaryPart = Part1
  179. Part1.Name = "Head"
  180. Part1.Parent = Model0
  181. Part1.BrickColor = BrickColor.new("CGA brown")
  182. Part1.Rotation = Vector3.new(52.4599991, 0, 0)
  183. Part1.Anchored = true
  184. Part1.Locked = true
  185. Part1.FormFactor = Enum.FormFactor.Symmetric
  186. Part1.Size = Vector3.new(2, 1, 1)
  187. Part1.CFrame = CFrame.new(0, 4.46677923, 0.278403997, 1, 0, 0, 0, 0.609307885, -0.792933822, 0, 0.792933822, 0.609307885)
  188. Part1.TopSurface = Enum.SurfaceType.Smooth
  189. Part1.Color = Color3.new(0.666667, 0.333333, 0)
  190. Part1.Position = Vector3.new(0, 4.46677923, 0.278403997)
  191. Part1.Orientation = Vector3.new(52.4599991, 0, 0)
  192. Part1.Color = Color3.new(0.666667, 0.333333, 0)
  193. Sound2.Name = "GettingUp"
  194. Sound2.Parent = Part1
  195. Sound2.SoundId = "rbxasset://sounds/action_get_up.mp3"
  196. Sound2.Volume = 0.64999997615814
  197. RemoteEvent3.Name = "CharacterSoundEvent"
  198. RemoteEvent3.Parent = Sound2
  199. Sound4.Name = "Died"
  200. Sound4.Parent = Part1
  201. Sound4.SoundId = "rbxasset://sounds/uuhhh.mp3"
  202. Sound4.Volume = 0.64999997615814
  203. RemoteEvent5.Name = "CharacterSoundEvent"
  204. RemoteEvent5.Parent = Sound4
  205. Sound6.Name = "FreeFalling"
  206. Sound6.Parent = Part1
  207. Sound6.SoundId = "rbxasset://sounds/action_falling.mp3"
  208. Sound6.TimePosition = 0.067105413782429
  209. Sound6.Volume = 0
  210. Sound6.Looped = true
  211. RemoteEvent7.Name = "CharacterSoundEvent"
  212. RemoteEvent7.Parent = Sound6
  213. Sound8.Name = "Jumping"
  214. Sound8.Parent = Part1
  215. Sound8.SoundId = "rbxasset://sounds/action_jump.mp3"
  216. Sound8.Volume = 0.64999997615814
  217. RemoteEvent9.Name = "CharacterSoundEvent"
  218. RemoteEvent9.Parent = Sound8
  219. Sound10.Name = "Landing"
  220. Sound10.Parent = Part1
  221. Sound10.SoundId = "rbxasset://sounds/action_jump_land.mp3"
  222. Sound10.Volume = 1
  223. RemoteEvent11.Name = "CharacterSoundEvent"
  224. RemoteEvent11.Parent = Sound10
  225. Sound12.Name = "Splash"
  226. Sound12.Parent = Part1
  227. Sound12.SoundId = "rbxasset://sounds/impact_water.mp3"
  228. Sound12.Volume = 0.64999997615814
  229. RemoteEvent13.Name = "CharacterSoundEvent"
  230. RemoteEvent13.Parent = Sound12
  231. Sound14.Name = "Running"
  232. Sound14.Parent = Part1
  233. Sound14.Pitch = 1.8500000238419
  234. Sound14.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  235. Sound14.Volume = 0.64999997615814
  236. Sound14.Looped = true
  237. RemoteEvent15.Name = "CharacterSoundEvent"
  238. RemoteEvent15.Parent = Sound14
  239. Sound16.Name = "Swimming"
  240. Sound16.Parent = Part1
  241. Sound16.Pitch = 1.6000000238419
  242. Sound16.SoundId = "rbxasset://sounds/action_swim.mp3"
  243. Sound16.Volume = 0.64999997615814
  244. Sound16.Looped = true
  245. RemoteEvent17.Name = "CharacterSoundEvent"
  246. RemoteEvent17.Parent = Sound16
  247. Sound18.Name = "Climbing"
  248. Sound18.Parent = Part1
  249. Sound18.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  250. Sound18.Volume = 0.64999997615814
  251. Sound18.Looped = true
  252. RemoteEvent19.Name = "CharacterSoundEvent"
  253. RemoteEvent19.Parent = Sound18
  254. SpecialMesh20.Parent = Part1
  255. SpecialMesh20.MeshId = "http://www.roblox.com/asset/?id=83001675"
  256. SpecialMesh20.Scale = Vector3.new(1.25, 1.25, 1.25)
  257. SpecialMesh20.MeshType = Enum.MeshType.FileMesh
  258. SpecialMesh20.Scale = Vector3.new(1.25, 1.25, 1.25)
  259. Decal21.Name = "face"
  260. Decal21.Parent = Part1
  261. Decal21.Texture = "http://www.roblox.com/asset/?id=144080495 "
  262. Part22.Name = "Torso"
  263. Part22.Parent = Model0
  264. Part22.BrickColor = BrickColor.new("CGA brown")
  265. Part22.Rotation = Vector3.new(8.72000027, 0, 0)
  266. Part22.Anchored = true
  267. Part22.Locked = true
  268. Part22.FormFactor = Enum.FormFactor.Symmetric
  269. Part22.Size = Vector3.new(2, 2, 1)
  270. Part22.CFrame = CFrame.new(0, 2.995543, 0.0448479988, 1, 0, 0, 0, 0.988437355, -0.151630059, 0, 0.151630059, 0.988437355)
  271. Part22.LeftSurface = Enum.SurfaceType.Weld
  272. Part22.RightSurface = Enum.SurfaceType.Weld
  273. Part22.Color = Color3.new(0.666667, 0.333333, 0)
  274. Part22.Position = Vector3.new(0, 2.995543, 0.0448479988)
  275. Part22.Orientation = Vector3.new(8.72000027, 0, 0)
  276. Part22.Color = Color3.new(0.666667, 0.333333, 0)
  277. Decal23.Name = "roblox"
  278. Decal23.Parent = Part22
  279. Part24.Name = "Left Arm"
  280. Part24.Parent = Model0
  281. Part24.BrickColor = BrickColor.new("CGA brown")
  282. Part24.Rotation = Vector3.new(39.4399986, 0, 0)
  283. Part24.Anchored = true
  284. Part24.CanCollide = false
  285. Part24.Locked = true
  286. Part24.FormFactor = Enum.FormFactor.Symmetric
  287. Part24.Size = Vector3.new(1, 2, 1)
  288. Part24.CFrame = CFrame.new(-1.5, 3.31320381, -0.341275781, 1, 0, 0, 0, 0.772247612, -0.635321677, 0, 0.635321677, 0.772247612)
  289. Part24.Color = Color3.new(0.666667, 0.333333, 0)
  290. Part24.Position = Vector3.new(-1.5, 3.31320381, -0.341275781)
  291. Part24.Orientation = Vector3.new(39.4399986, 0, 0)
  292. Part24.Color = Color3.new(0.666667, 0.333333, 0)
  293. Part25.Name = "Right Arm"
  294. Part25.Parent = Model0
  295. Part25.BrickColor = BrickColor.new("CGA brown")
  296. Part25.Rotation = Vector3.new(133.729996, 8.75, -12.4899998)
  297. Part25.Anchored = true
  298. Part25.CanCollide = false
  299. Part25.Locked = true
  300. Part25.FormFactor = Enum.FormFactor.Symmetric
  301. Part25.Size = Vector3.new(1, 2, 1)
  302. Part25.CFrame = CFrame.new(1.011567, 3.92417693, -0.99355799, 0.96496737, 0.213820562, 0.152048677, 0.256818086, -0.651179135, -0.714150012, -0.0536890179, 0.72818023, -0.683279574)
  303. Part25.Color = Color3.new(0.666667, 0.333333, 0)
  304. Part25.Position = Vector3.new(1.011567, 3.92417693, -0.99355799)
  305. Part25.Orientation = Vector3.new(45.5699997, 167.449997, 158.479996)
  306. Part25.Color = Color3.new(0.666667, 0.333333, 0)
  307. Part26.Name = "Left Leg"
  308. Part26.Parent = Model0
  309. Part26.BrickColor = BrickColor.new("CGA brown")
  310. Part26.Rotation = Vector3.new(-30.7299995, 0, 0)
  311. Part26.Anchored = true
  312. Part26.CanCollide = false
  313. Part26.Locked = true
  314. Part26.FormFactor = Enum.FormFactor.Symmetric
  315. Part26.Size = Vector3.new(1, 2, 1)
  316. Part26.CFrame = CFrame.new(-0.5, 1.09992146, 0.856665611, 1, 0, 0, 0, 0.859560609, 0.511033773, 0, -0.511033773, 0.859560609)
  317. Part26.BottomSurface = Enum.SurfaceType.Smooth
  318. Part26.Color = Color3.new(0.666667, 0.333333, 0)
  319. Part26.Position = Vector3.new(-0.5, 1.09992146, 0.856665611)
  320. Part26.Orientation = Vector3.new(-30.7299995, 0, 0)
  321. Part26.Color = Color3.new(0.666667, 0.333333, 0)
  322. Part27.Name = "Right Leg"
  323. Part27.Parent = Model0
  324. Part27.BrickColor = BrickColor.new("CGA brown")
  325. Part27.Rotation = Vector3.new(-16.8400002, 0, 0)
  326. Part27.Anchored = true
  327. Part27.CanCollide = false
  328. Part27.Locked = true
  329. Part27.FormFactor = Enum.FormFactor.Symmetric
  330. Part27.Size = Vector3.new(1, 2, 1)
  331. Part27.CFrame = CFrame.new(0.5, 1.16350722, 0.220150054, 1, 0, 0, 0, 0.957124233, 0.289678067, 0, -0.289678067, 0.957124233)
  332. Part27.BottomSurface = Enum.SurfaceType.Smooth
  333. Part27.Color = Color3.new(0.666667, 0.333333, 0)
  334. Part27.Position = Vector3.new(0.5, 1.16350722, 0.220150054)
  335. Part27.Orientation = Vector3.new(-16.8400002, 0, 0)
  336. Part27.Color = Color3.new(0.666667, 0.333333, 0)
  337. Humanoid28.Name = "Unkillable_Crystal5241"
  338. Humanoid28.Parent = Model0
  339. Humanoid28.RightLeg = Part27
  340. Humanoid28.LeftLeg = Part26
  341. Humanoid28.Torso = Part29
  342. Humanoid28.Health = inf
  343. Humanoid28.MaxHealth = inf
  344. Part29.Name = "HumanoidRootPart"
  345. Part29.Parent = Model0
  346. Part29.Transparency = 1
  347. Part29.Rotation = Vector3.new(8.72000027, 0, 0)
  348. Part29.Anchored = true
  349. Part29.CanCollide = false
  350. Part29.Locked = true
  351. Part29.FormFactor = Enum.FormFactor.Symmetric
  352. Part29.Size = Vector3.new(2, 2, 1)
  353. Part29.CFrame = CFrame.new(0, 2.995543, 0.0448479988, 1, 0, 0, 0, 0.988437355, -0.151630059, 0, 0.151630059, 0.988437355)
  354. Part29.BottomSurface = Enum.SurfaceType.Smooth
  355. Part29.TopSurface = Enum.SurfaceType.Smooth
  356. Part29.Position = Vector3.new(0, 2.995543, 0.0448479988)
  357. Part29.Orientation = Vector3.new(8.72000027, 0, 0)
  358. Motor6D30.Name = "RootJoint"
  359. Motor6D30.Parent = Part29
  360. Motor6D30.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  361. Motor6D30.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  362. Motor6D30.Part0 = Part29
  363. Motor6D30.Part1 = Part22
  364. Motor6D30.MaxVelocity = 0.10000000149012
  365. Script31.Name = "Sound"
  366. Script31.Parent = Model0
  367. table.insert(cors,sandbox(Script31,function()
  368. --[[
  369. Author: @spotco
  370. This script creates sounds which are placed under the character head.
  371. These sounds are used by the "LocalSound" script.
  372.  
  373. To modify this script, copy it to your "StarterPlayer/StarterCharacterScripts" folder keeping the same script name ("Sound").
  374. The default Sound script loaded for every character will then be replaced with your copy of the script.
  375. ]]--
  376. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  377. local Players = game:GetService("Players")
  378.  
  379. local SOUND_EVENT_FOLDER_NAME = "DefaultSoundEvents"
  380. local DEFAULT_SERVER_SOUND_EVENT_NAME = "DefaultServerSoundEvent"
  381.  
  382. local SoundEventFolder = ReplicatedStorage:FindFirstChild(SOUND_EVENT_FOLDER_NAME)
  383. local DefaultServerSoundEvent = nil
  384.  
  385. local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
  386. if useSoundDispatcher then
  387. if not SoundEventFolder then
  388. SoundEventFolder = Instance.new("Folder")
  389. SoundEventFolder.Name = SOUND_EVENT_FOLDER_NAME
  390. SoundEventFolder.Archivable = false
  391. SoundEventFolder.Parent = ReplicatedStorage
  392. end
  393.  
  394. DefaultServerSoundEvent = SoundEventFolder:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
  395. else
  396. DefaultServerSoundEvent = ReplicatedStorage:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
  397. end
  398.  
  399. if not DefaultServerSoundEvent then
  400. if useSoundDispatcher then
  401. DefaultServerSoundEvent = Instance.new("RemoteEvent", SoundEventFolder)
  402. else
  403. DefaultServerSoundEvent = Instance.new("RemoteEvent", ReplicatedStorage)
  404. end
  405.  
  406. DefaultServerSoundEvent.Name = DEFAULT_SERVER_SOUND_EVENT_NAME
  407. DefaultServerSoundEvent.OnServerEvent:Connect(function() end)
  408. end
  409.  
  410. local function CreateNewSound(name, id, looped, pitch, parent)
  411. local sound = Instance.new("Sound")
  412. sound.SoundId = id
  413. sound.Name = name
  414. sound.archivable = false
  415. sound.Pitch = pitch
  416. sound.Looped = looped
  417. sound.MinDistance = 5
  418. sound.MaxDistance = 150
  419. sound.Volume = 0.65
  420. sound.Parent = parent
  421.  
  422. if DefaultServerSoundEvent then
  423. local CharacterSoundEvent = Instance.new("RemoteEvent", sound)
  424. CharacterSoundEvent.Name = "CharacterSoundEvent"
  425. CharacterSoundEvent.OnServerEvent:Connect(function(player, playing, resetPosition)
  426. if type(playing) ~= "boolean" then
  427. return
  428. end
  429. if type(resetPosition) ~= "boolean" then
  430. return
  431. end
  432.  
  433. if player.Character ~= script.Parent then
  434. return
  435. end
  436. for _, p in pairs(Players:GetPlayers()) do
  437. if p ~= player then
  438. -- Connect to the dispatcher to check if the player has loaded.
  439. if useSoundDispatcher then
  440. SoundEventFolder:FindFirstChild("SoundDispatcher"):Fire(p, sound, playing, resetPosition)
  441. else
  442. DefaultServerSoundEvent:FireClient(p, sound, playing, resetPosition)
  443. end
  444. end
  445. end
  446. end)
  447. end
  448. return sound
  449. end
  450.  
  451. local head = script.Parent:FindFirstChild("Head")
  452. if not head then
  453. error("Sound script parent has no child Head.")
  454. return
  455. end
  456.  
  457. CreateNewSound("GettingUp", "rbxasset://sounds/action_get_up.mp3", false, 1, head)
  458. CreateNewSound("Died", "rbxasset://sounds/uuhhh.mp3", false, 1, head)
  459. CreateNewSound("FreeFalling", "rbxasset://sounds/action_falling.mp3", true, 1, head)
  460. CreateNewSound("Jumping", "rbxasset://sounds/action_jump.mp3", false, 1, head)
  461. CreateNewSound("Landing", "rbxasset://sounds/action_jump_land.mp3", false, 1, head)
  462. CreateNewSound("Splash", "rbxasset://sounds/impact_water.mp3", false, 1, head)
  463. CreateNewSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1.85, head)
  464. CreateNewSound("Swimming", "rbxasset://sounds/action_swim.mp3", true, 1.6, head)
  465. CreateNewSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1, head)
  466. end))
  467. LocalScript32.Name = "LocalSound"
  468. LocalScript32.Parent = Script31
  469. table.insert(cors,sandbox(LocalScript32,function()
  470. --[[
  471. Author: @spotco
  472. This script runs locally for the player of the given humanoid.
  473. This script triggers humanoid sound play/pause actions locally.
  474.  
  475. The Playing/TimePosition properties of Sound objects bypass FilteringEnabled, so this triggers the sound
  476. immediately for the player and is replicated to all other players.
  477.  
  478. This script is optimized to reduce network traffic through minimizing the amount of property replication.
  479. ]]--
  480.  
  481. --All sounds are referenced by this ID
  482. local SFX = {
  483. Died = 0;
  484. Running = 1;
  485. Swimming = 2;
  486. Climbing = 3,
  487. Jumping = 4;
  488. GettingUp = 5;
  489. FreeFalling = 6;
  490. FallingDown = 7;
  491. Landing = 8;
  492. Splash = 9;
  493. }
  494.  
  495. local useUpdatedLocalSoundFlag = UserSettings():IsUserFeatureEnabled("UserFixCharacterSoundIssues")
  496.  
  497. local Humanoid = nil
  498. local Head = nil
  499. --SFX ID to Sound object
  500. local Sounds = {}
  501. local SoundService = game:GetService("SoundService")
  502. local soundEventFolderName = "DefaultSoundEvents"
  503. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  504. local AddCharacterLoadedEvent = nil
  505. local RemoveCharacterEvent = nil
  506. local soundEventFolder = ReplicatedStorage:FindFirstChild(soundEventFolderName)
  507. local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
  508.  
  509. if useSoundDispatcher then
  510. if not soundEventFolder then
  511. soundEventFolder = Instance.new("Folder", ReplicatedStorage)
  512. soundEventFolder.Name = soundEventFolderName
  513. soundEventFolder.Archivable = false
  514. end
  515.  
  516. -- Load the RemoveCharacterEvent
  517. RemoveCharacterEvent = soundEventFolder:FindFirstChild("RemoveCharacterEvent")
  518. if RemoveCharacterEvent == nil then
  519. RemoveCharacterEvent = Instance.new("RemoteEvent", soundEventFolder)
  520. RemoveCharacterEvent.Name = "RemoveCharacterEvent"
  521. end
  522.  
  523. AddCharacterLoadedEvent = soundEventFolder:FindFirstChild("AddCharacterLoadedEvent")
  524. if AddCharacterLoadedEvent == nil then
  525. AddCharacterLoadedEvent = Instance.new("RemoteEvent", soundEventFolder)
  526. AddCharacterLoadedEvent.Name = "AddCharacterLoadedEvent"
  527. end
  528.  
  529. -- Notify the server a new character has been loaded
  530. AddCharacterLoadedEvent:FireServer()
  531.  
  532. -- Notify the sound dispatcher this character has left.
  533. game.Players.LocalPlayer.CharacterRemoving:connect(function(character)
  534. RemoveCharacterEvent:FireServer(game.Players.LocalPlayer)
  535. end)
  536. end
  537.  
  538. do
  539. local Figure = script.Parent.Parent
  540. Head = Figure:WaitForChild("Head")
  541. while not Humanoid do
  542. for _,NewHumanoid in pairs(Figure:GetChildren()) do
  543. if NewHumanoid:IsA("Humanoid") then
  544. Humanoid = NewHumanoid
  545. break
  546. end
  547. end
  548. if Humanoid then break end
  549. Figure.ChildAdded:wait()
  550. end
  551. Sounds[SFX.Died] = Head:WaitForChild("Died")
  552. Sounds[SFX.Running] = Head:WaitForChild("Running")
  553. Sounds[SFX.Swimming] = Head:WaitForChild("Swimming")
  554. Sounds[SFX.Climbing] = Head:WaitForChild("Climbing")
  555. Sounds[SFX.Jumping] = Head:WaitForChild("Jumping")
  556. Sounds[SFX.GettingUp] = Head:WaitForChild("GettingUp")
  557. Sounds[SFX.FreeFalling] = Head:WaitForChild("FreeFalling")
  558. Sounds[SFX.Landing] = Head:WaitForChild("Landing")
  559. Sounds[SFX.Splash] = Head:WaitForChild("Splash")
  560.  
  561. local DefaultServerSoundEvent = nil
  562. if useSoundDispatcher then
  563. DefaultServerSoundEvent = soundEventFolder:FindFirstChild("DefaultServerSoundEvent")
  564. else
  565. DefaultServerSoundEvent = game:GetService("ReplicatedStorage"):FindFirstChild("DefaultServerSoundEvent")
  566. end
  567.  
  568. if DefaultServerSoundEvent then
  569. DefaultServerSoundEvent.OnClientEvent:connect(function(sound, playing, resetPosition)
  570. if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") then
  571. if resetPosition and sound.TimePosition ~= 0 then
  572. sound.TimePosition = 0
  573. end
  574. if sound.IsPlaying ~= playing then
  575. sound.Playing = playing
  576. end
  577. else
  578. if sound.TimePosition ~= 0 then
  579. sound.TimePosition = 0
  580. end
  581. if not sound.IsPlaying then
  582. sound.Playing = true
  583. end
  584. end
  585. end)
  586. end
  587. end
  588.  
  589. local IsSoundFilteringEnabled = function()
  590. return game.Workspace.FilteringEnabled and SoundService.RespectFilteringEnabled
  591. end
  592.  
  593. local Util
  594. Util = {
  595.  
  596. --Define linear relationship between (pt1x,pt2x) and (pt2x,pt2y). Evaluate this at x.
  597. YForLineGivenXAndTwoPts = function(x,pt1x,pt1y,pt2x,pt2y)
  598. --(y - y1)/(x - x1) = m
  599. local m = (pt1y - pt2y) / (pt1x - pt2x)
  600. --float b = pt1.y - m * pt1.x;
  601. local b = (pt1y - m * pt1x)
  602. return m * x + b
  603. end;
  604.  
  605. --Clamps the value of "val" between the "min" and "max"
  606. Clamp = function(val,min,max)
  607. return math.min(max,math.max(min,val))
  608. end;
  609.  
  610. --Gets the horizontal (x,z) velocity magnitude of the given part
  611. HorizontalSpeed = function(Head)
  612. local hVel = Head.Velocity + Vector3.new(0,-Head.Velocity.Y,0)
  613. return hVel.magnitude
  614. end;
  615.  
  616. --Gets the vertical (y) velocity magnitude of the given part
  617. VerticalSpeed = function(Head)
  618. return math.abs(Head.Velocity.Y)
  619. end;
  620.  
  621. --Setting Playing/TimePosition values directly result in less network traffic than Play/Pause/Resume/Stop
  622. --If these properties are enabled, use them.
  623. Play = function(sound)
  624. if IsSoundFilteringEnabled() then
  625. sound.CharacterSoundEvent:FireServer(true, true)
  626. end
  627. if sound.TimePosition ~= 0 then
  628. sound.TimePosition = 0
  629. end
  630. if not sound.IsPlaying then
  631. sound.Playing = true
  632. end
  633. end;
  634.  
  635. Pause = function(sound)
  636. if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
  637. sound.CharacterSoundEvent:FireServer(false, false)
  638. end
  639. if sound.IsPlaying then
  640. sound.Playing = false
  641. end
  642. end;
  643.  
  644. Resume = function(sound)
  645. if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
  646. sound.CharacterSoundEvent:FireServer(true, false)
  647. end
  648. if not sound.IsPlaying then
  649. sound.Playing = true
  650. end
  651. end;
  652.  
  653. Stop = function(sound)
  654. if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
  655. sound.CharacterSoundEvent:FireServer(false, true)
  656. end
  657. if sound.IsPlaying then
  658. sound.Playing = false
  659. end
  660. if sound.TimePosition ~= 0 then
  661. sound.TimePosition = 0
  662. end
  663. end;
  664. }
  665.  
  666. do
  667. -- List of all active Looped sounds
  668. local playingLoopedSounds = {}
  669.  
  670. -- Last seen Enum.HumanoidStateType
  671. local activeState = nil
  672.  
  673. local fallSpeed = 0
  674.  
  675. -- Verify and set that "sound" is in "playingLoopedSounds".
  676. function setSoundInPlayingLoopedSounds(sound)
  677. for i=1, #playingLoopedSounds do
  678. if playingLoopedSounds[i] == sound then
  679. return
  680. end
  681. end
  682. table.insert(playingLoopedSounds,sound)
  683. end
  684.  
  685. -- Stop all active looped sounds except parameter "except". If "except" is not passed, all looped sounds will be stopped.
  686. function stopPlayingLoopedSoundsExcept(except)
  687. for i=#playingLoopedSounds,1,-1 do
  688. if playingLoopedSounds[i] ~= except then
  689. Util.Pause(playingLoopedSounds[i])
  690. table.remove(playingLoopedSounds,i)
  691. end
  692. end
  693. end
  694.  
  695. -- Table of Enum.HumanoidStateType to handling function
  696. local stateUpdateHandler = {
  697. [Enum.HumanoidStateType.Dead] = function()
  698. stopPlayingLoopedSoundsExcept()
  699. local sound = Sounds[SFX.Died]
  700. Util.Play(sound)
  701. end;
  702.  
  703. [Enum.HumanoidStateType.RunningNoPhysics] = function(speed)
  704. stateUpdated(Enum.HumanoidStateType.Running, speed)
  705. end;
  706.  
  707. [Enum.HumanoidStateType.Running] = function(speed)
  708. local sound = Sounds[SFX.Running]
  709. stopPlayingLoopedSoundsExcept(sound)
  710.  
  711. if(useUpdatedLocalSoundFlag and activeState == Enum.HumanoidStateType.Freefall and fallSpeed > 0.1) then
  712. -- Play a landing sound if the character dropped from a large distance
  713. local vol = math.min(1.0, math.max(0.0, (fallSpeed - 50) / 110))
  714. local freeFallSound = Sounds[SFX.FreeFalling]
  715. freeFallSound.Volume = vol
  716. Util.Play(freeFallSound)
  717. fallSpeed = 0
  718. end
  719. if useUpdatedLocalSoundFlag then
  720. if speed ~= nil and speed > 0.5 then
  721. Util.Resume(sound)
  722. setSoundInPlayingLoopedSounds(sound)
  723. elseif speed ~= nil then
  724. stopPlayingLoopedSoundsExcept()
  725. end
  726. else
  727. if Util.HorizontalSpeed(Head) > 0.5 then
  728. Util.Resume(sound)
  729. setSoundInPlayingLoopedSounds(sound)
  730. else
  731. stopPlayingLoopedSoundsExcept()
  732. end
  733. end
  734. end;
  735.  
  736. [Enum.HumanoidStateType.Swimming] = function(speed)
  737. local threshold
  738. if useUpdatedLocalSoundFlag then threshold = speed else threshold = Util.VerticalSpeed(Head) end
  739. if activeState ~= Enum.HumanoidStateType.Swimming and threshold > 0.1 then
  740. local splashSound = Sounds[SFX.Splash]
  741. splashSound.Volume = Util.Clamp(
  742. Util.YForLineGivenXAndTwoPts(
  743. Util.VerticalSpeed(Head),
  744. 100, 0.28,
  745. 350, 1),
  746. 0,1)
  747. Util.Play(splashSound)
  748. end
  749.  
  750. do
  751. local sound = Sounds[SFX.Swimming]
  752. stopPlayingLoopedSoundsExcept(sound)
  753. Util.Resume(sound)
  754. setSoundInPlayingLoopedSounds(sound)
  755. end
  756. end;
  757.  
  758. [Enum.HumanoidStateType.Climbing] = function(speed)
  759. local sound = Sounds[SFX.Climbing]
  760. if useUpdatedLocalSoundFlag then
  761. if speed ~= nil and math.abs(speed) > 0.1 then
  762. Util.Resume(sound)
  763. stopPlayingLoopedSoundsExcept(sound)
  764. else
  765. Util.Pause(sound)
  766. stopPlayingLoopedSoundsExcept(sound)
  767. end
  768. else
  769. if Util.VerticalSpeed(Head) > 0.1 then
  770. Util.Resume(sound)
  771. stopPlayingLoopedSoundsExcept(sound)
  772. else
  773. stopPlayingLoopedSoundsExcept()
  774. end
  775. end
  776.  
  777. setSoundInPlayingLoopedSounds(sound)
  778. end;
  779.  
  780. [Enum.HumanoidStateType.Jumping] = function()
  781. if activeState == Enum.HumanoidStateType.Jumping then
  782. return
  783. end
  784. stopPlayingLoopedSoundsExcept()
  785. local sound = Sounds[SFX.Jumping]
  786. Util.Play(sound)
  787. end;
  788.  
  789. [Enum.HumanoidStateType.GettingUp] = function()
  790. stopPlayingLoopedSoundsExcept()
  791. local sound = Sounds[SFX.GettingUp]
  792. Util.Play(sound)
  793. end;
  794.  
  795. [Enum.HumanoidStateType.Freefall] = function()
  796. if activeState == Enum.HumanoidStateType.Freefall then
  797. return
  798. end
  799. local sound = Sounds[SFX.FreeFalling]
  800. sound.Volume = 0
  801. stopPlayingLoopedSoundsExcept()
  802.  
  803. fallSpeed = math.max(fallSpeed, math.abs(Head.Velocity.y))
  804. end;
  805.  
  806. [Enum.HumanoidStateType.FallingDown] = function()
  807. stopPlayingLoopedSoundsExcept()
  808. end;
  809.  
  810. [Enum.HumanoidStateType.Landed] = function()
  811. stopPlayingLoopedSoundsExcept()
  812. if Util.VerticalSpeed(Head) > 75 then
  813. local landingSound = Sounds[SFX.Landing]
  814. landingSound.Volume = Util.Clamp(
  815. Util.YForLineGivenXAndTwoPts(
  816. Util.VerticalSpeed(Head),
  817. 50, 0,
  818. 100, 1),
  819. 0,1)
  820. Util.Play(landingSound)
  821. end
  822. end;
  823.  
  824. [Enum.HumanoidStateType.Seated] = function()
  825. stopPlayingLoopedSoundsExcept()
  826. end;
  827. }
  828.  
  829.  
  830.  
  831. -- Handle state event fired or OnChange fired
  832. function stateUpdated(state, speed)
  833. if stateUpdateHandler[state] ~= nil then
  834. if useUpdatedLocalSoundFlag and (state == Enum.HumanoidStateType.Running
  835. or state == Enum.HumanoidStateType.Climbing
  836. or state == Enum.HumanoidStateType.Swimming
  837. or state == Enum.HumanoidStateType.RunningNoPhysics) then
  838. stateUpdateHandler[state](speed)
  839. else
  840. stateUpdateHandler[state]()
  841. end
  842. end
  843. activeState = state
  844. end
  845.  
  846. Humanoid.Died:connect( function() stateUpdated(Enum.HumanoidStateType.Dead) end)
  847. Humanoid.Running:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Running, speed) end)
  848. Humanoid.Swimming:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Swimming, speed) end)
  849. Humanoid.Climbing:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Climbing, speed) end)
  850. Humanoid.Jumping:connect( function() stateUpdated(Enum.HumanoidStateType.Jumping) end)
  851. Humanoid.GettingUp:connect( function() stateUpdated(Enum.HumanoidStateType.GettingUp) end)
  852. Humanoid.FreeFalling:connect( function() stateUpdated(Enum.HumanoidStateType.Freefall) end)
  853. Humanoid.FallingDown:connect( function() stateUpdated(Enum.HumanoidStateType.FallingDown) end)
  854.  
  855.  
  856.  
  857. -- required for proper handling of Landed event
  858.  
  859. Humanoid.StateChanged:connect(function(old, new)
  860. stateUpdated(new)
  861. end)
  862.  
  863.  
  864.  
  865. function onUpdate(stepDeltaSeconds, tickSpeedSeconds)
  866. local stepScale = stepDeltaSeconds / tickSpeedSeconds
  867. do
  868. local sound = Sounds[SFX.FreeFalling]
  869. if activeState == Enum.HumanoidStateType.Freefall then
  870. if Head.Velocity.Y < 0 and Util.VerticalSpeed(Head) > 75 then
  871. Util.Resume(sound)
  872.  
  873. --Volume takes 1.1 seconds to go from volume 0 to 1
  874. local ANIMATION_LENGTH_SECONDS = 1.1
  875.  
  876. local normalizedIncrement = tickSpeedSeconds / ANIMATION_LENGTH_SECONDS
  877. sound.Volume = Util.Clamp(sound.Volume + normalizedIncrement * stepScale, 0, 1)
  878. else
  879. sound.Volume = 0
  880. end
  881. else
  882. Util.Pause(sound)
  883. end
  884. end
  885.  
  886. do
  887. local sound = Sounds[SFX.Running]
  888. if activeState == Enum.HumanoidStateType.Running then
  889. if Util.HorizontalSpeed(Head) < 0.5 then
  890. Util.Pause(sound)
  891. end
  892. end
  893. end
  894. end
  895.  
  896.  
  897. local lastTick = tick()
  898. local TICK_SPEED_SECONDS = 0.25
  899. while true do
  900. onUpdate(tick() - lastTick,TICK_SPEED_SECONDS)
  901. lastTick = tick()
  902. wait(TICK_SPEED_SECONDS)
  903. end
  904.  
  905. end
  906.  
  907. end))
  908. Script33.Name = "Health"
  909. Script33.Parent = Model0
  910. table.insert(cors,sandbox(Script33,function()
  911. -- Gradually regenerates the Humanoid's Health over time.
  912.  
  913. local REGEN_RATE = 1/100 -- Regenerate this fraction of MaxHealth per second.
  914. local REGEN_STEP = 1 -- Wait this long between each regeneration step.
  915.  
  916. --------------------------------------------------------------------------------
  917.  
  918. local Character = script.Parent
  919. local Humanoid = Character:WaitForChild'Humanoid'
  920.  
  921. --------------------------------------------------------------------------------
  922.  
  923. while true do
  924. while Humanoid.Health < Humanoid.MaxHealth do
  925. local dt = wait(REGEN_STEP)
  926. local dh = dt*REGEN_RATE*Humanoid.MaxHealth
  927. Humanoid.Health = math.min(Humanoid.Health + dh, Humanoid.MaxHealth)
  928. end
  929. Humanoid.HealthChanged:Wait()
  930. end
  931. end))
  932. LocalScript34.Name = "Animate"
  933. LocalScript34.Parent = Model0
  934. table.insert(cors,sandbox(LocalScript34,function()
  935. local Figure = script.Parent
  936. local Torso = Figure:WaitForChild("Torso")
  937. local RightShoulder = Torso:WaitForChild("Right Shoulder")
  938. local LeftShoulder = Torso:WaitForChild("Left Shoulder")
  939. local RightHip = Torso:WaitForChild("Right Hip")
  940. local LeftHip = Torso:WaitForChild("Left Hip")
  941. local Neck = Torso:WaitForChild("Neck")
  942. local Humanoid = Figure:WaitForChild("Humanoid")
  943. local pose = "Standing"
  944.  
  945. local currentAnim = ""
  946. local currentAnimInstance = nil
  947. local currentAnimTrack = nil
  948. local currentAnimKeyframeHandler = nil
  949. local currentAnimSpeed = 1.0
  950. local animTable = {}
  951. local animNames = {
  952. idle = {
  953. { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  954. { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  955. },
  956. walk = {
  957. { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  958. },
  959. run = {
  960. { id = "run.xml", weight = 10 }
  961. },
  962. jump = {
  963. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  964. },
  965. fall = {
  966. { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  967. },
  968. climb = {
  969. { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  970. },
  971. sit = {
  972. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  973. },
  974. toolnone = {
  975. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  976. },
  977. toolslash = {
  978. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  979. -- { id = "slash.xml", weight = 10 }
  980. },
  981. toollunge = {
  982. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  983. },
  984. wave = {
  985. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  986. },
  987. point = {
  988. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  989. },
  990. dance1 = {
  991. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  992. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  993. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  994. },
  995. dance2 = {
  996. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  997. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  998. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  999. },
  1000. dance3 = {
  1001. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  1002. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  1003. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  1004. },
  1005. laugh = {
  1006. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  1007. },
  1008. cheer = {
  1009. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  1010. },
  1011. }
  1012. local dances = {"dance1", "dance2", "dance3"}
  1013.  
  1014. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  1015. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  1016.  
  1017. function configureAnimationSet(name, fileList)
  1018. if (animTable[name] ~= nil) then
  1019. for _, connection in pairs(animTable[name].connections) do
  1020. connection:disconnect()
  1021. end
  1022. end
  1023. animTable[name] = {}
  1024. animTable[name].count = 0
  1025. animTable[name].totalWeight = 0
  1026. animTable[name].connections = {}
  1027.  
  1028. -- check for config values
  1029. local config = script:FindFirstChild(name)
  1030. if (config ~= nil) then
  1031. -- print("Loading anims " .. name)
  1032. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  1033. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  1034. local idx = 1
  1035. for _, childPart in pairs(config:GetChildren()) do
  1036. if (childPart:IsA("Animation")) then
  1037. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  1038. animTable[name][idx] = {}
  1039. animTable[name][idx].anim = childPart
  1040. local weightObject = childPart:FindFirstChild("Weight")
  1041. if (weightObject == nil) then
  1042. animTable[name][idx].weight = 1
  1043. else
  1044. animTable[name][idx].weight = weightObject.Value
  1045. end
  1046. animTable[name].count = animTable[name].count + 1
  1047. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  1048. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  1049. idx = idx + 1
  1050. end
  1051. end
  1052. end
  1053.  
  1054. -- fallback to defaults
  1055. if (animTable[name].count <= 0) then
  1056. for idx, anim in pairs(fileList) do
  1057. animTable[name][idx] = {}
  1058. animTable[name][idx].anim = Instance.new("Animation")
  1059. animTable[name][idx].anim.Name = name
  1060. animTable[name][idx].anim.AnimationId = anim.id
  1061. animTable[name][idx].weight = anim.weight
  1062. animTable[name].count = animTable[name].count + 1
  1063. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  1064. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  1065. end
  1066. end
  1067. end
  1068.  
  1069. -- Setup animation objects
  1070. function scriptChildModified(child)
  1071. local fileList = animNames[child.Name]
  1072. if (fileList ~= nil) then
  1073. configureAnimationSet(child.Name, fileList)
  1074. end
  1075. end
  1076.  
  1077. script.ChildAdded:connect(scriptChildModified)
  1078. script.ChildRemoved:connect(scriptChildModified)
  1079.  
  1080.  
  1081. for name, fileList in pairs(animNames) do
  1082. configureAnimationSet(name, fileList)
  1083. end
  1084.  
  1085. -- ANIMATION
  1086.  
  1087. -- declarations
  1088. local toolAnim = "None"
  1089. local toolAnimTime = 0
  1090.  
  1091. local jumpAnimTime = 0
  1092. local jumpAnimDuration = 0.3
  1093.  
  1094. local toolTransitionTime = 0.1
  1095. local fallTransitionTime = 0.3
  1096. local jumpMaxLimbVelocity = 0.75
  1097.  
  1098. -- functions
  1099.  
  1100. function stopAllAnimations()
  1101. local oldAnim = currentAnim
  1102.  
  1103. -- return to idle if finishing an emote
  1104. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  1105. oldAnim = "idle"
  1106. end
  1107.  
  1108. currentAnim = ""
  1109. currentAnimInstance = nil
  1110. if (currentAnimKeyframeHandler ~= nil) then
  1111. currentAnimKeyframeHandler:disconnect()
  1112. end
  1113.  
  1114. if (currentAnimTrack ~= nil) then
  1115. currentAnimTrack:Stop()
  1116. currentAnimTrack:Destroy()
  1117. currentAnimTrack = nil
  1118. end
  1119. return oldAnim
  1120. end
  1121.  
  1122. function setAnimationSpeed(speed)
  1123. if speed ~= currentAnimSpeed then
  1124. currentAnimSpeed = speed
  1125. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  1126. end
  1127. end
  1128.  
  1129. function keyFrameReachedFunc(frameName)
  1130. if (frameName == "End") then
  1131.  
  1132. local repeatAnim = currentAnim
  1133. -- return to idle if finishing an emote
  1134. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  1135. repeatAnim = "idle"
  1136. end
  1137.  
  1138. local animSpeed = currentAnimSpeed
  1139. playAnimation(repeatAnim, 0.0, Humanoid)
  1140. setAnimationSpeed(animSpeed)
  1141. end
  1142. end
  1143.  
  1144. -- Preload animations
  1145. function playAnimation(animName, transitionTime, humanoid)
  1146.  
  1147. local roll = math.random(1, animTable[animName].totalWeight)
  1148. local origRoll = roll
  1149. local idx = 1
  1150. while (roll > animTable[animName][idx].weight) do
  1151. roll = roll - animTable[animName][idx].weight
  1152. idx = idx + 1
  1153. end
  1154. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  1155. local anim = animTable[animName][idx].anim
  1156.  
  1157. -- switch animation
  1158. if (anim ~= currentAnimInstance) then
  1159.  
  1160. if (currentAnimTrack ~= nil) then
  1161. currentAnimTrack:Stop(transitionTime)
  1162. currentAnimTrack:Destroy()
  1163. end
  1164.  
  1165. currentAnimSpeed = 1.0
  1166.  
  1167. -- load it to the humanoid; get AnimationTrack
  1168. currentAnimTrack = humanoid:LoadAnimation(anim)
  1169. currentAnimTrack.Priority = Enum.AnimationPriority.Core
  1170.  
  1171. -- play the animation
  1172. currentAnimTrack:Play(transitionTime)
  1173. currentAnim = animName
  1174. currentAnimInstance = anim
  1175.  
  1176. -- set up keyframe name triggers
  1177. if (currentAnimKeyframeHandler ~= nil) then
  1178. currentAnimKeyframeHandler:disconnect()
  1179. end
  1180. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  1181.  
  1182. end
  1183.  
  1184. end
  1185.  
  1186. -------------------------------------------------------------------------------------------
  1187. -------------------------------------------------------------------------------------------
  1188.  
  1189. local toolAnimName = ""
  1190. local toolAnimTrack = nil
  1191. local toolAnimInstance = nil
  1192. local currentToolAnimKeyframeHandler = nil
  1193.  
  1194. function toolKeyFrameReachedFunc(frameName)
  1195. if (frameName == "End") then
  1196. -- print("Keyframe : ".. frameName)
  1197. playToolAnimation(toolAnimName, 0.0, Humanoid)
  1198. end
  1199. end
  1200.  
  1201.  
  1202. function playToolAnimation(animName, transitionTime, humanoid, priority)
  1203.  
  1204. local roll = math.random(1, animTable[animName].totalWeight)
  1205. local origRoll = roll
  1206. local idx = 1
  1207. while (roll > animTable[animName][idx].weight) do
  1208. roll = roll - animTable[animName][idx].weight
  1209. idx = idx + 1
  1210. end
  1211. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  1212. local anim = animTable[animName][idx].anim
  1213.  
  1214. if (toolAnimInstance ~= anim) then
  1215.  
  1216. if (toolAnimTrack ~= nil) then
  1217. toolAnimTrack:Stop()
  1218. toolAnimTrack:Destroy()
  1219. transitionTime = 0
  1220. end
  1221.  
  1222. -- load it to the humanoid; get AnimationTrack
  1223. toolAnimTrack = humanoid:LoadAnimation(anim)
  1224. if priority then
  1225. toolAnimTrack.Priority = priority
  1226. end
  1227.  
  1228. -- play the animation
  1229. toolAnimTrack:Play(transitionTime)
  1230. toolAnimName = animName
  1231. toolAnimInstance = anim
  1232.  
  1233. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  1234. end
  1235. end
  1236.  
  1237. function stopToolAnimations()
  1238. local oldAnim = toolAnimName
  1239.  
  1240. if (currentToolAnimKeyframeHandler ~= nil) then
  1241. currentToolAnimKeyframeHandler:disconnect()
  1242. end
  1243.  
  1244. toolAnimName = ""
  1245. toolAnimInstance = nil
  1246. if (toolAnimTrack ~= nil) then
  1247. toolAnimTrack:Stop()
  1248. toolAnimTrack:Destroy()
  1249. toolAnimTrack = nil
  1250. end
  1251.  
  1252.  
  1253. return oldAnim
  1254. end
  1255.  
  1256. -------------------------------------------------------------------------------------------
  1257. -------------------------------------------------------------------------------------------
  1258.  
  1259.  
  1260. function onRunning(speed)
  1261. if speed > 0.01 then
  1262. playAnimation("walk", 0.1, Humanoid)
  1263. if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  1264. setAnimationSpeed(speed / 14.5)
  1265. end
  1266. pose = "Running"
  1267. else
  1268. if emoteNames[currentAnim] == nil then
  1269. playAnimation("idle", 0.1, Humanoid)
  1270. pose = "Standing"
  1271. end
  1272. end
  1273. end
  1274.  
  1275. function onDied()
  1276. pose = "Dead"
  1277. end
  1278.  
  1279. function onJumping()
  1280. playAnimation("jump", 0.1, Humanoid)
  1281. jumpAnimTime = jumpAnimDuration
  1282. pose = "Jumping"
  1283. end
  1284.  
  1285. function onClimbing(speed)
  1286. playAnimation("climb", 0.1, Humanoid)
  1287. setAnimationSpeed(speed / 12.0)
  1288. pose = "Climbing"
  1289. end
  1290.  
  1291. function onGettingUp()
  1292. pose = "GettingUp"
  1293. end
  1294.  
  1295. function onFreeFall()
  1296. if (jumpAnimTime <= 0) then
  1297. playAnimation("fall", fallTransitionTime, Humanoid)
  1298. end
  1299. pose = "FreeFall"
  1300. end
  1301.  
  1302. function onFallingDown()
  1303. pose = "FallingDown"
  1304. end
  1305.  
  1306. function onSeated()
  1307. pose = "Seated"
  1308. end
  1309.  
  1310. function onPlatformStanding()
  1311. pose = "PlatformStanding"
  1312. end
  1313.  
  1314. function onSwimming(speed)
  1315. if speed > 0 then
  1316. pose = "Running"
  1317. else
  1318. pose = "Standing"
  1319. end
  1320. end
  1321.  
  1322. function getTool()
  1323. for _, kid in ipairs(Figure:GetChildren()) do
  1324. if kid.className == "Tool" then return kid end
  1325. end
  1326. return nil
  1327. end
  1328.  
  1329. function getToolAnim(tool)
  1330. for _, c in ipairs(tool:GetChildren()) do
  1331. if c.Name == "toolanim" and c.className == "StringValue" then
  1332. return c
  1333. end
  1334. end
  1335. return nil
  1336. end
  1337.  
  1338. function animateTool()
  1339.  
  1340. if (toolAnim == "None") then
  1341. playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
  1342. return
  1343. end
  1344.  
  1345. if (toolAnim == "Slash") then
  1346. playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
  1347. return
  1348. end
  1349.  
  1350. if (toolAnim == "Lunge") then
  1351. playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
  1352. return
  1353. end
  1354. end
  1355.  
  1356. function moveSit()
  1357. RightShoulder.MaxVelocity = 0.15
  1358. LeftShoulder.MaxVelocity = 0.15
  1359. RightShoulder:SetDesiredAngle(3.14 /2)
  1360. LeftShoulder:SetDesiredAngle(-3.14 /2)
  1361. RightHip:SetDesiredAngle(3.14 /2)
  1362. LeftHip:SetDesiredAngle(-3.14 /2)
  1363. end
  1364.  
  1365. local lastTick = 0
  1366.  
  1367. function move(time)
  1368. local amplitude = 1
  1369. local frequency = 1
  1370. local deltaTime = time - lastTick
  1371. lastTick = time
  1372.  
  1373. local climbFudge = 0
  1374. local setAngles = false
  1375.  
  1376. if (jumpAnimTime > 0) then
  1377. jumpAnimTime = jumpAnimTime - deltaTime
  1378. end
  1379.  
  1380. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1381. playAnimation("fall", fallTransitionTime, Humanoid)
  1382. elseif (pose == "Seated") then
  1383. playAnimation("sit", 0.5, Humanoid)
  1384. return
  1385. elseif (pose == "Running") then
  1386. playAnimation("walk", 0.1, Humanoid)
  1387. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1388. -- print("Wha " .. pose)
  1389. stopAllAnimations()
  1390. amplitude = 0.1
  1391. frequency = 1
  1392. setAngles = true
  1393. end
  1394.  
  1395. if (setAngles) then
  1396. local desiredAngle = amplitude * math.sin(time * frequency)
  1397.  
  1398. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  1399. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  1400. RightHip:SetDesiredAngle(-desiredAngle)
  1401. LeftHip:SetDesiredAngle(-desiredAngle)
  1402. end
  1403.  
  1404. -- Tool Animation handling
  1405. local tool = getTool()
  1406. if tool and tool:FindFirstChild("Handle") then
  1407.  
  1408. local animStringValueObject = getToolAnim(tool)
  1409.  
  1410. if animStringValueObject then
  1411. toolAnim = animStringValueObject.Value
  1412. -- message recieved, delete StringValue
  1413. animStringValueObject.Parent = nil
  1414. toolAnimTime = time + .3
  1415. end
  1416.  
  1417. if time > toolAnimTime then
  1418. toolAnimTime = 0
  1419. toolAnim = "None"
  1420. end
  1421.  
  1422. animateTool()
  1423. else
  1424. stopToolAnimations()
  1425. toolAnim = "None"
  1426. toolAnimInstance = nil
  1427. toolAnimTime = 0
  1428. end
  1429. end
  1430.  
  1431. -- connect events
  1432. Humanoid.Died:connect(onDied)
  1433. Humanoid.Running:connect(onRunning)
  1434. Humanoid.Jumping:connect(onJumping)
  1435. Humanoid.Climbing:connect(onClimbing)
  1436. Humanoid.GettingUp:connect(onGettingUp)
  1437. Humanoid.FreeFalling:connect(onFreeFall)
  1438. Humanoid.FallingDown:connect(onFallingDown)
  1439. Humanoid.Seated:connect(onSeated)
  1440. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1441. Humanoid.Swimming:connect(onSwimming)
  1442.  
  1443. -- setup emote chat hook
  1444. game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
  1445. local emote = ""
  1446. if msg == "/e dance" then
  1447. emote = dances[math.random(1, #dances)]
  1448. elseif (string.sub(msg, 1, 3) == "/e ") then
  1449. emote = string.sub(msg, 4)
  1450. elseif (string.sub(msg, 1, 7) == "/emote ") then
  1451. emote = string.sub(msg, 8)
  1452. end
  1453.  
  1454. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  1455. playAnimation(emote, 0.1, Humanoid)
  1456. end
  1457.  
  1458. end)
  1459.  
  1460.  
  1461. -- main program
  1462.  
  1463. -- initialize to idle
  1464. playAnimation("idle", 0.1, Humanoid)
  1465. pose = "Standing"
  1466.  
  1467. while Figure.Parent ~= nil do
  1468. local _, time = wait(0.1)
  1469. move(time)
  1470. end
  1471.  
  1472.  
  1473.  
  1474. end))
  1475. StringValue35.Name = "idle"
  1476. StringValue35.Parent = LocalScript34
  1477. Animation36.Name = "Animation1"
  1478. Animation36.Parent = StringValue35
  1479. Animation36.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  1480. NumberValue37.Name = "Weight"
  1481. NumberValue37.Parent = Animation36
  1482. NumberValue37.Value = 9
  1483. Animation38.Name = "Animation2"
  1484. Animation38.Parent = StringValue35
  1485. Animation38.AnimationId = "http://www.roblox.com/asset/?id=180435792"
  1486. NumberValue39.Name = "Weight"
  1487. NumberValue39.Parent = Animation38
  1488. NumberValue39.Value = 1
  1489. StringValue40.Name = "walk"
  1490. StringValue40.Parent = LocalScript34
  1491. Animation41.Name = "WalkAnim"
  1492. Animation41.Parent = StringValue40
  1493. Animation41.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1494. StringValue42.Name = "run"
  1495. StringValue42.Parent = LocalScript34
  1496. Animation43.Name = "RunAnim"
  1497. Animation43.Parent = StringValue42
  1498. Animation43.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1499. StringValue44.Name = "jump"
  1500. StringValue44.Parent = LocalScript34
  1501. Animation45.Name = "JumpAnim"
  1502. Animation45.Parent = StringValue44
  1503. Animation45.AnimationId = "http://www.roblox.com/asset/?id=125750702"
  1504. StringValue46.Name = "climb"
  1505. StringValue46.Parent = LocalScript34
  1506. Animation47.Name = "ClimbAnim"
  1507. Animation47.Parent = StringValue46
  1508. Animation47.AnimationId = "http://www.roblox.com/asset/?id=180436334"
  1509. StringValue48.Name = "toolnone"
  1510. StringValue48.Parent = LocalScript34
  1511. Animation49.Name = "ToolNoneAnim"
  1512. Animation49.Parent = StringValue48
  1513. Animation49.AnimationId = "http://www.roblox.com/asset/?id=182393478"
  1514. StringValue50.Name = "fall"
  1515. StringValue50.Parent = LocalScript34
  1516. Animation51.Name = "FallAnim"
  1517. Animation51.Parent = StringValue50
  1518. Animation51.AnimationId = "http://www.roblox.com/asset/?id=180436148"
  1519. StringValue52.Name = "sit"
  1520. StringValue52.Parent = LocalScript34
  1521. Animation53.Name = "SitAnim"
  1522. Animation53.Parent = StringValue52
  1523. Animation53.AnimationId = "http://www.roblox.com/asset/?id=178130996"
  1524. Pants54.Name = "Pants"
  1525. Pants54.Parent = Model0
  1526. Pants54.PantsTemplate = "http://www.roblox.com/asset/?id=1515127652"
  1527. Accessory55.Name = "Necklace"
  1528. Accessory55.Parent = Model0
  1529. Accessory55.AttachmentPos = Vector3.new(0, 0.980000019, 0)
  1530. Part56.Name = "Handle"
  1531. Part56.Parent = Accessory55
  1532. Part56.Rotation = Vector3.new(51.4799995, 0, 0)
  1533. Part56.Anchored = true
  1534. Part56.CanCollide = false
  1535. Part56.Locked = true
  1536. Part56.FormFactor = Enum.FormFactor.Symmetric
  1537. Part56.Size = Vector3.new(1, 1, 2)
  1538. Part56.CFrame = CFrame.new(0, 3.99185872, 0.118275687, 1, 0, 0, 0, 0.622849047, -0.782342136, 0, 0.782342136, 0.622849047)
  1539. Part56.BottomSurface = Enum.SurfaceType.Smooth
  1540. Part56.TopSurface = Enum.SurfaceType.Smooth
  1541. Part56.Position = Vector3.new(0, 3.99185872, 0.118275687)
  1542. Part56.Orientation = Vector3.new(51.4799995, 0, 0)
  1543. SpecialMesh57.Parent = Part56
  1544. SpecialMesh57.MeshId = "http://www.roblox.com/asset/?id=28461516"
  1545. SpecialMesh57.Scale = Vector3.new(1.14999998, 1.14999998, 1.25)
  1546. SpecialMesh57.TextureId = "http://www.roblox.com/asset/?id=376188163 "
  1547. SpecialMesh57.MeshType = Enum.MeshType.FileMesh
  1548. SpecialMesh57.Scale = Vector3.new(1.14999998, 1.14999998, 1.25)
  1549. CharacterMesh58.Parent = Model0
  1550. CharacterMesh58.MeshId = 27111894
  1551. CharacterMesh58.BodyPart = Enum.BodyPart.Torso
  1552. Accessory59.Name = "ThorHelmet"
  1553. Accessory59.Parent = Model0
  1554. Accessory59.AttachmentPos = Vector3.new(0, -0.150000006, 0.0250000004)
  1555. Part60.Name = "Handle"
  1556. Part60.Parent = Accessory59
  1557. Part60.Rotation = Vector3.new(51.4799995, 0, 0)
  1558. Part60.Anchored = true
  1559. Part60.CanCollide = false
  1560. Part60.Locked = true
  1561. Part60.FormFactor = Enum.FormFactor.Custom
  1562. Part60.Size = Vector3.new(1.80000019, 0.670001626, 2.00000024)
  1563. Part60.CFrame = CFrame.new(0, 4.78483105, 0.554270208, 1, 0, 0, 0, 0.622849047, -0.782342136, 0, 0.782342136, 0.622849047)
  1564. Part60.BottomSurface = Enum.SurfaceType.Smooth
  1565. Part60.TopSurface = Enum.SurfaceType.Smooth
  1566. Part60.Position = Vector3.new(0, 4.78483105, 0.554270208)
  1567. Part60.Orientation = Vector3.new(51.4799995, 0, 0)
  1568. SpecialMesh61.Parent = Part60
  1569. SpecialMesh61.MeshId = "rbxassetid://1076180901"
  1570. SpecialMesh61.TextureId = "rbxassetid://1076181316"
  1571. SpecialMesh61.MeshType = Enum.MeshType.FileMesh
  1572. Vector3Value62.Name = "OriginalSize"
  1573. Vector3Value62.Parent = Part60
  1574. Vector3Value62.Value = Vector3.new(1.80000019, 0.670001626, 2.00000024)
  1575. Accessory63.Name = "Bandana"
  1576. Accessory63.Parent = Model0
  1577. Accessory63.AttachmentPos = Vector3.new(0, 0.800000012, 0)
  1578. Part64.Name = "Handle"
  1579. Part64.Parent = Accessory63
  1580. Part64.Rotation = Vector3.new(51.4799995, 0, 0)
  1581. Part64.Anchored = true
  1582. Part64.CanCollide = false
  1583. Part64.Locked = true
  1584. Part64.FormFactor = Enum.FormFactor.Symmetric
  1585. Part64.Size = Vector3.new(1, 1, 1)
  1586. Part64.CFrame = CFrame.new(0, 4.20605421, -0.0905775428, 1, 0, 0, 0, 0.622849047, -0.782342136, 0, 0.782342136, 0.622849047)
  1587. Part64.BottomSurface = Enum.SurfaceType.Smooth
  1588. Part64.TopSurface = Enum.SurfaceType.Smooth
  1589. Part64.Position = Vector3.new(0, 4.20605421, -0.0905775428)
  1590. Part64.Orientation = Vector3.new(51.4799995, 0, 0)
  1591. SpecialMesh65.Parent = Part64
  1592. SpecialMesh65.MeshId = "http://www.roblox.com/asset/?id=20637493"
  1593. SpecialMesh65.Scale = Vector3.new(1, 0.899999976, 1)
  1594. SpecialMesh65.TextureId = "http://www.roblox.com/asset/?id=20637003"
  1595. SpecialMesh65.MeshType = Enum.MeshType.FileMesh
  1596. SpecialMesh65.Scale = Vector3.new(1, 0.899999976, 1)
  1597. Vector3Value66.Name = "OriginalSize"
  1598. Vector3Value66.Parent = Part64
  1599. Vector3Value66.Value = Vector3.new(1, 1, 1)
  1600. CharacterMesh67.Parent = Model0
  1601. CharacterMesh67.MeshId = 27111419
  1602. CharacterMesh67.BodyPart = Enum.BodyPart.LeftArm
  1603. Accessory68.Name = "RobloxVisor"
  1604. Accessory68.Parent = Model0
  1605. Accessory68.AttachmentPos = Vector3.new(0, 0.0500000007, 0.200000003)
  1606. Part69.Name = "Handle"
  1607. Part69.Parent = Accessory68
  1608. Part69.Rotation = Vector3.new(51.4799995, 0, 0)
  1609. Part69.Anchored = true
  1610. Part69.CanCollide = false
  1611. Part69.Locked = true
  1612. Part69.FormFactor = Enum.FormFactor.Symmetric
  1613. Part69.Size = Vector3.new(1.33000004, 1, 1.5)
  1614. Part69.CFrame = CFrame.new(0, 4.99831915, 0.422895133, 1, 0, 0, 0, 0.622849047, -0.782342136, 0, 0.782342136, 0.622849047)
  1615. Part69.BottomSurface = Enum.SurfaceType.Smooth
  1616. Part69.TopSurface = Enum.SurfaceType.Smooth
  1617. Part69.Position = Vector3.new(0, 4.99831915, 0.422895133)
  1618. Part69.Orientation = Vector3.new(51.4799995, 0, 0)
  1619. SpecialMesh70.Parent = Part69
  1620. SpecialMesh70.MeshId = "http://www.roblox.com/asset/?id=264715302 "
  1621. SpecialMesh70.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
  1622. SpecialMesh70.TextureId = "http://www.roblox.com/asset/?id=607960560"
  1623. SpecialMesh70.MeshType = Enum.MeshType.FileMesh
  1624. SpecialMesh70.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
  1625. Vector3Value71.Name = "OriginalSize"
  1626. Vector3Value71.Parent = Part69
  1627. Vector3Value71.Value = Vector3.new(1.33000004, 1, 1.5)
  1628. CharacterMesh72.Name = "Roblox 2.0 Right Arm"
  1629. CharacterMesh72.Parent = Model0
  1630. CharacterMesh72.MeshId = 27111864
  1631. CharacterMesh72.BodyPart = Enum.BodyPart.RightArm
  1632. CharacterMesh73.Parent = Model0
  1633. CharacterMesh73.MeshId = 27111857
  1634. CharacterMesh73.BodyPart = Enum.BodyPart.LeftLeg
  1635. CharacterMesh74.Parent = Model0
  1636. CharacterMesh74.MeshId = 27111882
  1637. CharacterMesh74.BodyPart = Enum.BodyPart.RightLeg
  1638. Shirt75.Name = "Shirt"
  1639. Shirt75.Parent = Model0
  1640. Shirt75.ShirtTemplate = "http://www.roblox.com/asset/?id=1176813991"
  1641. Accessory76.Name = "PurpleHair"
  1642. Accessory76.Parent = Model0
  1643. Accessory76.AttachmentPos = Vector3.new(0, 0.340000004, 0.25)
  1644. Part77.Name = "Handle"
  1645. Part77.Parent = Accessory76
  1646. Part77.Rotation = Vector3.new(51.4799995, 0, 0)
  1647. Part77.Anchored = true
  1648. Part77.CanCollide = false
  1649. Part77.Locked = true
  1650. Part77.FormFactor = Enum.FormFactor.Custom
  1651. Part77.Size = Vector3.new(1.60002756, 0.800000012, 1.59999776)
  1652. Part77.CFrame = CFrame.new(0, 4.77948141, 0.661035657, 1, 0, 0, 0, 0.622849047, -0.782342136, 0, 0.782342136, 0.622849047)
  1653. Part77.BottomSurface = Enum.SurfaceType.Smooth
  1654. Part77.TopSurface = Enum.SurfaceType.Smooth
  1655. Part77.Position = Vector3.new(0, 4.77948141, 0.661035657)
  1656. Part77.Orientation = Vector3.new(51.4799995, 0, 0)
  1657. SpecialMesh78.Parent = Part77
  1658. SpecialMesh78.MeshId = "rbxassetid://667528488"
  1659. SpecialMesh78.TextureId = "rbxassetid://845828015"
  1660. SpecialMesh78.MeshType = Enum.MeshType.FileMesh
  1661. Vector3Value79.Name = "OriginalSize"
  1662. Vector3Value79.Parent = Part77
  1663. Vector3Value79.Value = Vector3.new(1.60002756, 0.800000012, 1.59999776)
  1664. Model80.Parent = mas
  1665. Part81.Name = "Handle"
  1666. Part81.Parent = Model80
  1667. Part81.BrickColor = BrickColor.new("Dark stone grey")
  1668. Part81.Reflectance = 0.40000000596046
  1669. Part81.Rotation = Vector3.new(-58.4499969, -11.6999998, 84.6699982)
  1670. Part81.Anchored = true
  1671. Part81.Locked = true
  1672. Part81.FormFactor = Enum.FormFactor.Plate
  1673. Part81.Size = Vector3.new(1, 0.800000012, 4)
  1674. Part81.CFrame = CFrame.new(0.443211198, 5.71565056, -1.17533004, 0.0910439938, -0.974978328, -0.202801108, 0.537021935, -0.123431161, 0.834489167, -0.838640869, -0.184883863, 0.512347043)
  1675. Part81.BottomSurface = Enum.SurfaceType.Smooth
  1676. Part81.TopSurface = Enum.SurfaceType.Smooth
  1677. Part81.Color = Color3.new(0.388235, 0.372549, 0.384314)
  1678. Part81.Position = Vector3.new(0.443211198, 5.71565056, -1.17533004)
  1679. Part81.Orientation = Vector3.new(-56.5599976, -21.6000004, 102.939995)
  1680. Part81.Color = Color3.new(0.388235, 0.372549, 0.384314)
  1681. SpecialMesh82.Parent = Part81
  1682. SpecialMesh82.MeshId = "rbxasset://fonts/sword.mesh"
  1683. SpecialMesh82.TextureId = "rbxasset://textures/SwordTexture.png"
  1684. SpecialMesh82.MeshType = Enum.MeshType.FileMesh
  1685. Part83.Parent = Model80
  1686. Part83.Material = Enum.Material.Wood
  1687. Part83.BrickColor = BrickColor.new("Dark orange")
  1688. Part83.Rotation = Vector3.new(-11.46, 0, 0)
  1689. Part83.Anchored = true
  1690. Part83.Shape = Enum.PartType.Cylinder
  1691. Part83.Size = Vector3.new(0.25, 0.700000048, 0.899999976)
  1692. Part83.CFrame = CFrame.new(1.5, 7.01640511, -0.963681042, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1693. Part83.BottomSurface = Enum.SurfaceType.Smooth
  1694. Part83.TopSurface = Enum.SurfaceType.Smooth
  1695. Part83.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1696. Part83.Position = Vector3.new(1.5, 7.01640511, -0.963681042)
  1697. Part83.Orientation = Vector3.new(-11.46, 0, 0)
  1698. Part83.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1699. Part84.Parent = Model80
  1700. Part84.Material = Enum.Material.Wood
  1701. Part84.BrickColor = BrickColor.new("Dark orange")
  1702. Part84.Rotation = Vector3.new(-11.46, 0, 0)
  1703. Part84.Anchored = true
  1704. Part84.Shape = Enum.PartType.Cylinder
  1705. Part84.Size = Vector3.new(0.25, 0.700000048, 0.899999976)
  1706. Part84.CFrame = CFrame.new(1, 7.01640511, -0.963681042, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1707. Part84.BottomSurface = Enum.SurfaceType.Smooth
  1708. Part84.TopSurface = Enum.SurfaceType.Smooth
  1709. Part84.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1710. Part84.Position = Vector3.new(1, 7.01640511, -0.963681042)
  1711. Part84.Orientation = Vector3.new(-11.46, 0, 0)
  1712. Part84.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1713. Part85.Parent = Model80
  1714. Part85.Material = Enum.Material.Wood
  1715. Part85.BrickColor = BrickColor.new("Dark orange")
  1716. Part85.Rotation = Vector3.new(-11.46, 0, 0)
  1717. Part85.Anchored = true
  1718. Part85.Shape = Enum.PartType.Cylinder
  1719. Part85.Size = Vector3.new(0.25, 0.5, 0.5)
  1720. Part85.CFrame = CFrame.new(1.25, 7.00648022, -1.01268113, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1721. Part85.BottomSurface = Enum.SurfaceType.Smooth
  1722. Part85.TopSurface = Enum.SurfaceType.Smooth
  1723. Part85.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1724. Part85.Position = Vector3.new(1.25, 7.00648022, -1.01268113)
  1725. Part85.Orientation = Vector3.new(-11.46, 0, 0)
  1726. Part85.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1727. Part86.Parent = Model80
  1728. Part86.Material = Enum.Material.Wood
  1729. Part86.BrickColor = BrickColor.new("Dark orange")
  1730. Part86.Rotation = Vector3.new(-11.46, 0, 0)
  1731. Part86.Anchored = true
  1732. Part86.Shape = Enum.PartType.Cylinder
  1733. Part86.Size = Vector3.new(0.25, 0.700000048, 0.899999976)
  1734. Part86.CFrame = CFrame.new(0.5, 7.01640511, -0.963681042, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1735. Part86.BottomSurface = Enum.SurfaceType.Smooth
  1736. Part86.TopSurface = Enum.SurfaceType.Smooth
  1737. Part86.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1738. Part86.Position = Vector3.new(0.5, 7.01640511, -0.963681042)
  1739. Part86.Orientation = Vector3.new(-11.46, 0, 0)
  1740. Part86.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1741. Part87.Parent = Model80
  1742. Part87.Material = Enum.Material.Wood
  1743. Part87.BrickColor = BrickColor.new("Dark orange")
  1744. Part87.Rotation = Vector3.new(-11.46, 0, 0)
  1745. Part87.Anchored = true
  1746. Part87.Shape = Enum.PartType.Cylinder
  1747. Part87.Size = Vector3.new(0.25, 0.5, 0.5)
  1748. Part87.CFrame = CFrame.new(0.75, 7.00648022, -1.01268113, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1749. Part87.BottomSurface = Enum.SurfaceType.Smooth
  1750. Part87.TopSurface = Enum.SurfaceType.Smooth
  1751. Part87.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1752. Part87.Position = Vector3.new(0.75, 7.00648022, -1.01268113)
  1753. Part87.Orientation = Vector3.new(-11.46, 0, 0)
  1754. Part87.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1755. Part88.Parent = Model80
  1756. Part88.Material = Enum.Material.Wood
  1757. Part88.BrickColor = BrickColor.new("Dark orange")
  1758. Part88.Rotation = Vector3.new(-11.46, 0, 0)
  1759. Part88.Anchored = true
  1760. Part88.Shape = Enum.PartType.Cylinder
  1761. Part88.Size = Vector3.new(0.25, 0.5, 0.5)
  1762. Part88.CFrame = CFrame.new(0.25, 7.00648022, -1.01268113, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1763. Part88.BottomSurface = Enum.SurfaceType.Smooth
  1764. Part88.TopSurface = Enum.SurfaceType.Smooth
  1765. Part88.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1766. Part88.Position = Vector3.new(0.25, 7.00648022, -1.01268113)
  1767. Part88.Orientation = Vector3.new(-11.46, 0, 0)
  1768. Part88.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1769. Part89.Parent = Model80
  1770. Part89.Material = Enum.Material.Wood
  1771. Part89.BrickColor = BrickColor.new("Dark orange")
  1772. Part89.Rotation = Vector3.new(-11.46, 0, 0)
  1773. Part89.Anchored = true
  1774. Part89.Shape = Enum.PartType.Cylinder
  1775. Part89.Size = Vector3.new(0.25, 0.700000048, 0.899999976)
  1776. Part89.CFrame = CFrame.new(0, 7.01640511, -0.963681042, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1777. Part89.BottomSurface = Enum.SurfaceType.Smooth
  1778. Part89.TopSurface = Enum.SurfaceType.Smooth
  1779. Part89.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1780. Part89.Position = Vector3.new(0, 7.01640511, -0.963681042)
  1781. Part89.Orientation = Vector3.new(-11.46, 0, 0)
  1782. Part89.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1783. Part90.Parent = Model80
  1784. Part90.Material = Enum.Material.Wood
  1785. Part90.BrickColor = BrickColor.new("Dark orange")
  1786. Part90.Rotation = Vector3.new(-11.46, 0, 0)
  1787. Part90.Anchored = true
  1788. Part90.Shape = Enum.PartType.Cylinder
  1789. Part90.Size = Vector3.new(0.25, 0.700000048, 0.899999976)
  1790. Part90.CFrame = CFrame.new(-0.5, 7.01640511, -0.963681042, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1791. Part90.BottomSurface = Enum.SurfaceType.Smooth
  1792. Part90.TopSurface = Enum.SurfaceType.Smooth
  1793. Part90.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1794. Part90.Position = Vector3.new(-0.5, 7.01640511, -0.963681042)
  1795. Part90.Orientation = Vector3.new(-11.46, 0, 0)
  1796. Part90.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1797. Part91.Parent = Model80
  1798. Part91.Material = Enum.Material.Wood
  1799. Part91.BrickColor = BrickColor.new("Dark orange")
  1800. Part91.Rotation = Vector3.new(-11.46, 0, 0)
  1801. Part91.Anchored = true
  1802. Part91.Shape = Enum.PartType.Cylinder
  1803. Part91.Size = Vector3.new(0.25, 0.5, 0.5)
  1804. Part91.CFrame = CFrame.new(-0.25, 7.00648022, -1.01268113, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1805. Part91.BottomSurface = Enum.SurfaceType.Smooth
  1806. Part91.TopSurface = Enum.SurfaceType.Smooth
  1807. Part91.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1808. Part91.Position = Vector3.new(-0.25, 7.00648022, -1.01268113)
  1809. Part91.Orientation = Vector3.new(-11.46, 0, 0)
  1810. Part91.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1811. Part92.Parent = Model80
  1812. Part92.Material = Enum.Material.Wood
  1813. Part92.BrickColor = BrickColor.new("Dark orange")
  1814. Part92.Rotation = Vector3.new(-11.46, 0, 0)
  1815. Part92.Anchored = true
  1816. Part92.Shape = Enum.PartType.Cylinder
  1817. Part92.Size = Vector3.new(0.25, 0.5, 0.5)
  1818. Part92.CFrame = CFrame.new(-0.75, 7.00648022, -1.01268113, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1819. Part92.BottomSurface = Enum.SurfaceType.Smooth
  1820. Part92.TopSurface = Enum.SurfaceType.Smooth
  1821. Part92.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1822. Part92.Position = Vector3.new(-0.75, 7.00648022, -1.01268113)
  1823. Part92.Orientation = Vector3.new(-11.46, 0, 0)
  1824. Part92.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1825. Part93.Parent = Model80
  1826. Part93.Material = Enum.Material.Wood
  1827. Part93.BrickColor = BrickColor.new("Dark orange")
  1828. Part93.Rotation = Vector3.new(-11.46, 0, 0)
  1829. Part93.Anchored = true
  1830. Part93.Shape = Enum.PartType.Cylinder
  1831. Part93.Size = Vector3.new(0.25, 0.700000048, 0.899999976)
  1832. Part93.CFrame = CFrame.new(-1, 7.01640511, -0.963681042, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1833. Part93.BottomSurface = Enum.SurfaceType.Smooth
  1834. Part93.TopSurface = Enum.SurfaceType.Smooth
  1835. Part93.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1836. Part93.Position = Vector3.new(-1, 7.01640511, -0.963681042)
  1837. Part93.Orientation = Vector3.new(-11.46, 0, 0)
  1838. Part93.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1839. Part94.Parent = Model80
  1840. Part94.Material = Enum.Material.Wood
  1841. Part94.BrickColor = BrickColor.new("Dark orange")
  1842. Part94.Rotation = Vector3.new(-11.46, 0, 0)
  1843. Part94.Anchored = true
  1844. Part94.Shape = Enum.PartType.Cylinder
  1845. Part94.Size = Vector3.new(0.25, 0.5, 0.5)
  1846. Part94.CFrame = CFrame.new(-1.25, 7.00648022, -1.01268113, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1847. Part94.BottomSurface = Enum.SurfaceType.Smooth
  1848. Part94.TopSurface = Enum.SurfaceType.Smooth
  1849. Part94.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1850. Part94.Position = Vector3.new(-1.25, 7.00648022, -1.01268113)
  1851. Part94.Orientation = Vector3.new(-11.46, 0, 0)
  1852. Part94.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1853. Part95.Parent = Model80
  1854. Part95.Material = Enum.Material.Wood
  1855. Part95.BrickColor = BrickColor.new("Dark orange")
  1856. Part95.Rotation = Vector3.new(-11.46, 0, 0)
  1857. Part95.Anchored = true
  1858. Part95.Shape = Enum.PartType.Cylinder
  1859. Part95.Size = Vector3.new(0.25, 0.700000048, 0.899999976)
  1860. Part95.CFrame = CFrame.new(-1.5, 7.01640511, -0.963681042, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1861. Part95.BottomSurface = Enum.SurfaceType.Smooth
  1862. Part95.TopSurface = Enum.SurfaceType.Smooth
  1863. Part95.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1864. Part95.Position = Vector3.new(-1.5, 7.01640511, -0.963681042)
  1865. Part95.Orientation = Vector3.new(-11.46, 0, 0)
  1866. Part95.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1867. Part96.Parent = Model80
  1868. Part96.Material = Enum.Material.Wood
  1869. Part96.BrickColor = BrickColor.new("Dark orange")
  1870. Part96.Rotation = Vector3.new(-11.46, 0, 0)
  1871. Part96.Anchored = true
  1872. Part96.Shape = Enum.PartType.Cylinder
  1873. Part96.Size = Vector3.new(0.25, 0.700000048, 0.899999976)
  1874. Part96.CFrame = CFrame.new(1.75, 7.01640511, -0.963681042, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1875. Part96.BottomSurface = Enum.SurfaceType.Smooth
  1876. Part96.TopSurface = Enum.SurfaceType.Smooth
  1877. Part96.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1878. Part96.Position = Vector3.new(1.75, 7.01640511, -0.963681042)
  1879. Part96.Orientation = Vector3.new(-11.46, 0, 0)
  1880. Part96.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1881. Part97.Parent = Model80
  1882. Part97.Material = Enum.Material.Wood
  1883. Part97.BrickColor = BrickColor.new("Dark orange")
  1884. Part97.Rotation = Vector3.new(-11.46, 0, 0)
  1885. Part97.Anchored = true
  1886. Part97.Shape = Enum.PartType.Cylinder
  1887. Part97.Size = Vector3.new(0.25, 0.700000048, 0.899999976)
  1888. Part97.CFrame = CFrame.new(-1.75, 7.01640511, -0.963681042, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  1889. Part97.BottomSurface = Enum.SurfaceType.Smooth
  1890. Part97.TopSurface = Enum.SurfaceType.Smooth
  1891. Part97.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1892. Part97.Position = Vector3.new(-1.75, 7.01640511, -0.963681042)
  1893. Part97.Orientation = Vector3.new(-11.46, 0, 0)
  1894. Part97.Color = Color3.new(0.627451, 0.372549, 0.207843)
  1895. Model98.Name = "reset4852258"
  1896. Model98.Parent = mas
  1897. Model98.PrimaryPart = Part99
  1898. Part99.Name = "Head"
  1899. Part99.Parent = Model98
  1900. Part99.BrickColor = BrickColor.new("Light orange")
  1901. Part99.Rotation = Vector3.new(-168.229996, 0, 0)
  1902. Part99.Anchored = true
  1903. Part99.Locked = true
  1904. Part99.FormFactor = Enum.FormFactor.Symmetric
  1905. Part99.Size = Vector3.new(2, 1, 1)
  1906. Part99.CFrame = CFrame.new(3.93465438e-09, 8.50928497, -1.9829061, 1, 7.87137555e-09, -3.26223034e-24, 7.70596742e-09, -0.978986144, 0.203927025, 1.60518621e-09, -0.203927025, -0.978986144)
  1907. Part99.TopSurface = Enum.SurfaceType.Smooth
  1908. Part99.Color = Color3.new(0.917647, 0.721569, 0.572549)
  1909. Part99.Position = Vector3.new(3.93465438e-09, 8.50928497, -1.9829061)
  1910. Part99.Orientation = Vector3.new(-11.7699995, -180, 180)
  1911. Part99.Color = Color3.new(0.917647, 0.721569, 0.572549)
  1912. SpecialMesh100.Parent = Part99
  1913. SpecialMesh100.Scale = Vector3.new(1.25, 1.25, 1.25)
  1914. SpecialMesh100.Scale = Vector3.new(1.25, 1.25, 1.25)
  1915. Sound101.Name = "GettingUp"
  1916. Sound101.Parent = Part99
  1917. Sound101.SoundId = "rbxasset://sounds/action_get_up.mp3"
  1918. Sound101.Volume = 0.64999997615814
  1919. RemoteEvent102.Name = "CharacterSoundEvent"
  1920. RemoteEvent102.Parent = Sound101
  1921. Sound103.Name = "Died"
  1922. Sound103.Parent = Part99
  1923. Sound103.SoundId = "rbxasset://sounds/uuhhh.mp3"
  1924. Sound103.Volume = 0.64999997615814
  1925. RemoteEvent104.Name = "CharacterSoundEvent"
  1926. RemoteEvent104.Parent = Sound103
  1927. Sound105.Name = "FreeFalling"
  1928. Sound105.Parent = Part99
  1929. Sound105.SoundId = "rbxasset://sounds/action_falling.mp3"
  1930. Sound105.TimePosition = 0.033058470674973
  1931. Sound105.Volume = 0.25191351771355
  1932. Sound105.Looped = true
  1933. RemoteEvent106.Name = "CharacterSoundEvent"
  1934. RemoteEvent106.Parent = Sound105
  1935. Sound107.Name = "Jumping"
  1936. Sound107.Parent = Part99
  1937. Sound107.SoundId = "rbxasset://sounds/action_jump.mp3"
  1938. Sound107.Volume = 0.64999997615814
  1939. RemoteEvent108.Name = "CharacterSoundEvent"
  1940. RemoteEvent108.Parent = Sound107
  1941. Sound109.Name = "Landing"
  1942. Sound109.Parent = Part99
  1943. Sound109.SoundId = "rbxasset://sounds/action_jump_land.mp3"
  1944. Sound109.Volume = 1
  1945. RemoteEvent110.Name = "CharacterSoundEvent"
  1946. RemoteEvent110.Parent = Sound109
  1947. Sound111.Name = "Splash"
  1948. Sound111.Parent = Part99
  1949. Sound111.SoundId = "rbxasset://sounds/impact_water.mp3"
  1950. Sound111.Volume = 0.64999997615814
  1951. RemoteEvent112.Name = "CharacterSoundEvent"
  1952. RemoteEvent112.Parent = Sound111
  1953. Sound113.Name = "Running"
  1954. Sound113.Parent = Part99
  1955. Sound113.Pitch = 1.8500000238419
  1956. Sound113.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  1957. Sound113.Volume = 0.64999997615814
  1958. Sound113.Looped = true
  1959. RemoteEvent114.Name = "CharacterSoundEvent"
  1960. RemoteEvent114.Parent = Sound113
  1961. Sound115.Name = "Swimming"
  1962. Sound115.Parent = Part99
  1963. Sound115.Pitch = 1.6000000238419
  1964. Sound115.SoundId = "rbxasset://sounds/action_swim.mp3"
  1965. Sound115.Volume = 0.64999997615814
  1966. Sound115.Looped = true
  1967. RemoteEvent116.Name = "CharacterSoundEvent"
  1968. RemoteEvent116.Parent = Sound115
  1969. Sound117.Name = "Climbing"
  1970. Sound117.Parent = Part99
  1971. Sound117.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  1972. Sound117.Volume = 0.64999997615814
  1973. Sound117.Looped = true
  1974. RemoteEvent118.Name = "CharacterSoundEvent"
  1975. RemoteEvent118.Parent = Sound117
  1976. Decal119.Name = "face"
  1977. Decal119.Parent = Part99
  1978. Decal119.Texture = "http://www.roblox.com/asset/?id=14861556"
  1979. Part120.Name = "Torso"
  1980. Part120.Parent = Model98
  1981. Part120.BrickColor = BrickColor.new("Light orange")
  1982. Part120.Rotation = Vector3.new(-142.720001, 0, 0)
  1983. Part120.Anchored = true
  1984. Part120.Locked = true
  1985. Part120.FormFactor = Enum.FormFactor.Symmetric
  1986. Part120.Size = Vector3.new(2, 2, 1)
  1987. Part120.CFrame = CFrame.new(0, 9.46127796, -0.917588115, 1, 0, 0, 0, -0.795691371, 0.605702281, 0, -0.605702281, -0.795691371)
  1988. Part120.LeftSurface = Enum.SurfaceType.Weld
  1989. Part120.RightSurface = Enum.SurfaceType.Weld
  1990. Part120.Color = Color3.new(0.917647, 0.721569, 0.572549)
  1991. Part120.Position = Vector3.new(0, 9.46127796, -0.917588115)
  1992. Part120.Orientation = Vector3.new(-37.2799988, 180, 180)
  1993. Part120.Color = Color3.new(0.917647, 0.721569, 0.572549)
  1994. Decal121.Name = "roblox"
  1995. Decal121.Parent = Part120
  1996. Part122.Name = "Left Arm"
  1997. Part122.Parent = Model98
  1998. Part122.BrickColor = BrickColor.new("Light orange")
  1999. Part122.Rotation = Vector3.new(-11.46, 0, 0)
  2000. Part122.Anchored = true
  2001. Part122.CanCollide = false
  2002. Part122.Locked = true
  2003. Part122.FormFactor = Enum.FormFactor.Symmetric
  2004. Part122.Size = Vector3.new(1, 2, 1)
  2005. Part122.CFrame = CFrame.new(-1.5, 8.32946014, -1.2405709, 1, 0, 0, 0, 0.98007524, 0.19862704, 0, -0.19862704, 0.98007524)
  2006. Part122.Color = Color3.new(0.917647, 0.721569, 0.572549)
  2007. Part122.Position = Vector3.new(-1.5, 8.32946014, -1.2405709)
  2008. Part122.Orientation = Vector3.new(-11.46, 0, 0)
  2009. Part122.Color = Color3.new(0.917647, 0.721569, 0.572549)
  2010. Part123.Name = "Right Arm"
  2011. Part123.Parent = Model98
  2012. Part123.BrickColor = BrickColor.new("Light orange")
  2013. Part123.Rotation = Vector3.new(-9.59000015, 0, 0)
  2014. Part123.Anchored = true
  2015. Part123.CanCollide = false
  2016. Part123.Locked = true
  2017. Part123.FormFactor = Enum.FormFactor.Symmetric
  2018. Part123.Size = Vector3.new(1, 2, 1)
  2019. Part123.CFrame = CFrame.new(1.5, 8.38019943, -1.26994395, 1, 0, 0, 0, 0.98603034, 0.166566059, 0, -0.166566059, 0.98603034)
  2020. Part123.Color = Color3.new(0.917647, 0.721569, 0.572549)
  2021. Part123.Position = Vector3.new(1.5, 8.38019943, -1.26994395)
  2022. Part123.Orientation = Vector3.new(-9.59000015, 0, 0)
  2023. Part123.Color = Color3.new(0.917647, 0.721569, 0.572549)
  2024. Part124.Name = "Left Leg"
  2025. Part124.Parent = Model98
  2026. Part124.BrickColor = BrickColor.new("Light orange")
  2027. Part124.Rotation = Vector3.new(143.770004, 0, 0)
  2028. Part124.Anchored = true
  2029. Part124.CanCollide = false
  2030. Part124.Locked = true
  2031. Part124.FormFactor = Enum.FormFactor.Symmetric
  2032. Part124.Size = Vector3.new(1, 2, 1)
  2033. Part124.CFrame = CFrame.new(-0.5, 11.1632748, -0.655006409, 1, 0, 0, 0, -0.806658268, -0.59101826, 0, 0.59101826, -0.806658268)
  2034. Part124.BottomSurface = Enum.SurfaceType.Smooth
  2035. Part124.Color = Color3.new(0.917647, 0.721569, 0.572549)
  2036. Part124.Position = Vector3.new(-0.5, 11.1632748, -0.655006409)
  2037. Part124.Orientation = Vector3.new(36.2299995, 180, 180)
  2038. Part124.Color = Color3.new(0.917647, 0.721569, 0.572549)
  2039. Part125.Name = "Right Leg"
  2040. Part125.Parent = Model98
  2041. Part125.BrickColor = BrickColor.new("Light orange")
  2042. Part125.Rotation = Vector3.new(145.020004, 0, 0)
  2043. Part125.Anchored = true
  2044. Part125.CanCollide = false
  2045. Part125.Locked = true
  2046. Part125.FormFactor = Enum.FormFactor.Symmetric
  2047. Part125.Size = Vector3.new(1, 2, 1)
  2048. Part125.CFrame = CFrame.new(0.5, 11.2412996, -0.570427716, 1, 0, 0, 0, -0.819374979, -0.573257983, 0, 0.573257983, -0.819374979)
  2049. Part125.BottomSurface = Enum.SurfaceType.Smooth
  2050. Part125.Color = Color3.new(0.917647, 0.721569, 0.572549)
  2051. Part125.Position = Vector3.new(0.5, 11.2412996, -0.570427716)
  2052. Part125.Orientation = Vector3.new(34.9799995, 180, 180)
  2053. Part125.Color = Color3.new(0.917647, 0.721569, 0.572549)
  2054. Humanoid126.Name = "Unkillable_reset4852258"
  2055. Humanoid126.Parent = Model98
  2056. Humanoid126.RightLeg = Part125
  2057. Humanoid126.LeftLeg = Part124
  2058. Humanoid126.Torso = Part127
  2059. Humanoid126.Health = inf
  2060. Humanoid126.MaxHealth = inf
  2061. Part127.Name = "HumanoidRootPart"
  2062. Part127.Parent = Model98
  2063. Part127.Transparency = 1
  2064. Part127.Rotation = Vector3.new(-142.720001, 0, 0)
  2065. Part127.Anchored = true
  2066. Part127.CanCollide = false
  2067. Part127.Locked = true
  2068. Part127.FormFactor = Enum.FormFactor.Symmetric
  2069. Part127.Size = Vector3.new(2, 2, 1)
  2070. Part127.CFrame = CFrame.new(0, 9.46127796, -0.917588115, 1, 0, 0, 0, -0.795691371, 0.605702281, 0, -0.605702281, -0.795691371)
  2071. Part127.BottomSurface = Enum.SurfaceType.Smooth
  2072. Part127.TopSurface = Enum.SurfaceType.Smooth
  2073. Part127.Position = Vector3.new(0, 9.46127796, -0.917588115)
  2074. Part127.Orientation = Vector3.new(-37.2799988, 180, 180)
  2075. Motor6D128.Name = "RootJoint"
  2076. Motor6D128.Parent = Part127
  2077. Motor6D128.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  2078. Motor6D128.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  2079. Motor6D128.Part0 = Part127
  2080. Motor6D128.Part1 = Part120
  2081. Motor6D128.MaxVelocity = 0.10000000149012
  2082. Script129.Name = "Sound"
  2083. Script129.Parent = Model98
  2084. table.insert(cors,sandbox(Script129,function()
  2085. --[[
  2086. Author: @spotco
  2087. This script creates sounds which are placed under the character head.
  2088. These sounds are used by the "LocalSound" script.
  2089.  
  2090. To modify this script, copy it to your "StarterPlayer/StarterCharacterScripts" folder keeping the same script name ("Sound").
  2091. The default Sound script loaded for every character will then be replaced with your copy of the script.
  2092. ]]--
  2093. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2094. local Players = game:GetService("Players")
  2095.  
  2096. local SOUND_EVENT_FOLDER_NAME = "DefaultSoundEvents"
  2097. local DEFAULT_SERVER_SOUND_EVENT_NAME = "DefaultServerSoundEvent"
  2098.  
  2099. local SoundEventFolder = ReplicatedStorage:FindFirstChild(SOUND_EVENT_FOLDER_NAME)
  2100. local DefaultServerSoundEvent = nil
  2101.  
  2102. local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
  2103. if useSoundDispatcher then
  2104. if not SoundEventFolder then
  2105. SoundEventFolder = Instance.new("Folder")
  2106. SoundEventFolder.Name = SOUND_EVENT_FOLDER_NAME
  2107. SoundEventFolder.Archivable = false
  2108. SoundEventFolder.Parent = ReplicatedStorage
  2109. end
  2110.  
  2111. DefaultServerSoundEvent = SoundEventFolder:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
  2112. else
  2113. DefaultServerSoundEvent = ReplicatedStorage:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
  2114. end
  2115.  
  2116. if not DefaultServerSoundEvent then
  2117. if useSoundDispatcher then
  2118. DefaultServerSoundEvent = Instance.new("RemoteEvent", SoundEventFolder)
  2119. else
  2120. DefaultServerSoundEvent = Instance.new("RemoteEvent", ReplicatedStorage)
  2121. end
  2122.  
  2123. DefaultServerSoundEvent.Name = DEFAULT_SERVER_SOUND_EVENT_NAME
  2124. DefaultServerSoundEvent.OnServerEvent:Connect(function() end)
  2125. end
  2126.  
  2127. local function CreateNewSound(name, id, looped, pitch, parent)
  2128. local sound = Instance.new("Sound")
  2129. sound.SoundId = id
  2130. sound.Name = name
  2131. sound.archivable = false
  2132. sound.Pitch = pitch
  2133. sound.Looped = looped
  2134. sound.MinDistance = 5
  2135. sound.MaxDistance = 150
  2136. sound.Volume = 0.65
  2137. sound.Parent = parent
  2138.  
  2139. if DefaultServerSoundEvent then
  2140. local CharacterSoundEvent = Instance.new("RemoteEvent", sound)
  2141. CharacterSoundEvent.Name = "CharacterSoundEvent"
  2142. CharacterSoundEvent.OnServerEvent:Connect(function(player, playing, resetPosition)
  2143. if type(playing) ~= "boolean" then
  2144. return
  2145. end
  2146. if type(resetPosition) ~= "boolean" then
  2147. return
  2148. end
  2149.  
  2150. if player.Character ~= script.Parent then
  2151. return
  2152. end
  2153. for _, p in pairs(Players:GetPlayers()) do
  2154. if p ~= player then
  2155. -- Connect to the dispatcher to check if the player has loaded.
  2156. if useSoundDispatcher then
  2157. SoundEventFolder:FindFirstChild("SoundDispatcher"):Fire(p, sound, playing, resetPosition)
  2158. else
  2159. DefaultServerSoundEvent:FireClient(p, sound, playing, resetPosition)
  2160. end
  2161. end
  2162. end
  2163. end)
  2164. end
  2165. return sound
  2166. end
  2167.  
  2168. local head = script.Parent:FindFirstChild("Head")
  2169. if not head then
  2170. error("Sound script parent has no child Head.")
  2171. return
  2172. end
  2173.  
  2174. CreateNewSound("GettingUp", "rbxasset://sounds/action_get_up.mp3", false, 1, head)
  2175. CreateNewSound("Died", "rbxasset://sounds/uuhhh.mp3", false, 1, head)
  2176. CreateNewSound("FreeFalling", "rbxasset://sounds/action_falling.mp3", true, 1, head)
  2177. CreateNewSound("Jumping", "rbxasset://sounds/action_jump.mp3", false, 1, head)
  2178. CreateNewSound("Landing", "rbxasset://sounds/action_jump_land.mp3", false, 1, head)
  2179. CreateNewSound("Splash", "rbxasset://sounds/impact_water.mp3", false, 1, head)
  2180. CreateNewSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1.85, head)
  2181. CreateNewSound("Swimming", "rbxasset://sounds/action_swim.mp3", true, 1.6, head)
  2182. CreateNewSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1, head)
  2183. end))
  2184. LocalScript130.Name = "LocalSound"
  2185. LocalScript130.Parent = Script129
  2186. table.insert(cors,sandbox(LocalScript130,function()
  2187. --[[
  2188. Author: @spotco
  2189. This script runs locally for the player of the given humanoid.
  2190. This script triggers humanoid sound play/pause actions locally.
  2191.  
  2192. The Playing/TimePosition properties of Sound objects bypass FilteringEnabled, so this triggers the sound
  2193. immediately for the player and is replicated to all other players.
  2194.  
  2195. This script is optimized to reduce network traffic through minimizing the amount of property replication.
  2196. ]]--
  2197.  
  2198. --All sounds are referenced by this ID
  2199. local SFX = {
  2200. Died = 0;
  2201. Running = 1;
  2202. Swimming = 2;
  2203. Climbing = 3,
  2204. Jumping = 4;
  2205. GettingUp = 5;
  2206. FreeFalling = 6;
  2207. FallingDown = 7;
  2208. Landing = 8;
  2209. Splash = 9;
  2210. }
  2211.  
  2212. local useUpdatedLocalSoundFlag = UserSettings():IsUserFeatureEnabled("UserFixCharacterSoundIssues")
  2213.  
  2214. local Humanoid = nil
  2215. local Head = nil
  2216. --SFX ID to Sound object
  2217. local Sounds = {}
  2218. local SoundService = game:GetService("SoundService")
  2219. local soundEventFolderName = "DefaultSoundEvents"
  2220. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2221. local AddCharacterLoadedEvent = nil
  2222. local RemoveCharacterEvent = nil
  2223. local soundEventFolder = ReplicatedStorage:FindFirstChild(soundEventFolderName)
  2224. local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
  2225.  
  2226. if useSoundDispatcher then
  2227. if not soundEventFolder then
  2228. soundEventFolder = Instance.new("Folder", ReplicatedStorage)
  2229. soundEventFolder.Name = soundEventFolderName
  2230. soundEventFolder.Archivable = false
  2231. end
  2232.  
  2233. -- Load the RemoveCharacterEvent
  2234. RemoveCharacterEvent = soundEventFolder:FindFirstChild("RemoveCharacterEvent")
  2235. if RemoveCharacterEvent == nil then
  2236. RemoveCharacterEvent = Instance.new("RemoteEvent", soundEventFolder)
  2237. RemoveCharacterEvent.Name = "RemoveCharacterEvent"
  2238. end
  2239.  
  2240. AddCharacterLoadedEvent = soundEventFolder:FindFirstChild("AddCharacterLoadedEvent")
  2241. if AddCharacterLoadedEvent == nil then
  2242. AddCharacterLoadedEvent = Instance.new("RemoteEvent", soundEventFolder)
  2243. AddCharacterLoadedEvent.Name = "AddCharacterLoadedEvent"
  2244. end
  2245.  
  2246. -- Notify the server a new character has been loaded
  2247. AddCharacterLoadedEvent:FireServer()
  2248.  
  2249. -- Notify the sound dispatcher this character has left.
  2250. game.Players.LocalPlayer.CharacterRemoving:connect(function(character)
  2251. RemoveCharacterEvent:FireServer(game.Players.LocalPlayer)
  2252. end)
  2253. end
  2254.  
  2255. do
  2256. local Figure = script.Parent.Parent
  2257. Head = Figure:WaitForChild("Head")
  2258. while not Humanoid do
  2259. for _,NewHumanoid in pairs(Figure:GetChildren()) do
  2260. if NewHumanoid:IsA("Humanoid") then
  2261. Humanoid = NewHumanoid
  2262. break
  2263. end
  2264. end
  2265. if Humanoid then break end
  2266. Figure.ChildAdded:wait()
  2267. end
  2268. Sounds[SFX.Died] = Head:WaitForChild("Died")
  2269. Sounds[SFX.Running] = Head:WaitForChild("Running")
  2270. Sounds[SFX.Swimming] = Head:WaitForChild("Swimming")
  2271. Sounds[SFX.Climbing] = Head:WaitForChild("Climbing")
  2272. Sounds[SFX.Jumping] = Head:WaitForChild("Jumping")
  2273. Sounds[SFX.GettingUp] = Head:WaitForChild("GettingUp")
  2274. Sounds[SFX.FreeFalling] = Head:WaitForChild("FreeFalling")
  2275. Sounds[SFX.Landing] = Head:WaitForChild("Landing")
  2276. Sounds[SFX.Splash] = Head:WaitForChild("Splash")
  2277.  
  2278. local DefaultServerSoundEvent = nil
  2279. if useSoundDispatcher then
  2280. DefaultServerSoundEvent = soundEventFolder:FindFirstChild("DefaultServerSoundEvent")
  2281. else
  2282. DefaultServerSoundEvent = game:GetService("ReplicatedStorage"):FindFirstChild("DefaultServerSoundEvent")
  2283. end
  2284.  
  2285. if DefaultServerSoundEvent then
  2286. DefaultServerSoundEvent.OnClientEvent:connect(function(sound, playing, resetPosition)
  2287. if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") then
  2288. if resetPosition and sound.TimePosition ~= 0 then
  2289. sound.TimePosition = 0
  2290. end
  2291. if sound.IsPlaying ~= playing then
  2292. sound.Playing = playing
  2293. end
  2294. else
  2295. if sound.TimePosition ~= 0 then
  2296. sound.TimePosition = 0
  2297. end
  2298. if not sound.IsPlaying then
  2299. sound.Playing = true
  2300. end
  2301. end
  2302. end)
  2303. end
  2304. end
  2305.  
  2306. local IsSoundFilteringEnabled = function()
  2307. return game.Workspace.FilteringEnabled and SoundService.RespectFilteringEnabled
  2308. end
  2309.  
  2310. local Util
  2311. Util = {
  2312.  
  2313. --Define linear relationship between (pt1x,pt2x) and (pt2x,pt2y). Evaluate this at x.
  2314. YForLineGivenXAndTwoPts = function(x,pt1x,pt1y,pt2x,pt2y)
  2315. --(y - y1)/(x - x1) = m
  2316. local m = (pt1y - pt2y) / (pt1x - pt2x)
  2317. --float b = pt1.y - m * pt1.x;
  2318. local b = (pt1y - m * pt1x)
  2319. return m * x + b
  2320. end;
  2321.  
  2322. --Clamps the value of "val" between the "min" and "max"
  2323. Clamp = function(val,min,max)
  2324. return math.min(max,math.max(min,val))
  2325. end;
  2326.  
  2327. --Gets the horizontal (x,z) velocity magnitude of the given part
  2328. HorizontalSpeed = function(Head)
  2329. local hVel = Head.Velocity + Vector3.new(0,-Head.Velocity.Y,0)
  2330. return hVel.magnitude
  2331. end;
  2332.  
  2333. --Gets the vertical (y) velocity magnitude of the given part
  2334. VerticalSpeed = function(Head)
  2335. return math.abs(Head.Velocity.Y)
  2336. end;
  2337.  
  2338. --Setting Playing/TimePosition values directly result in less network traffic than Play/Pause/Resume/Stop
  2339. --If these properties are enabled, use them.
  2340. Play = function(sound)
  2341. if IsSoundFilteringEnabled() then
  2342. sound.CharacterSoundEvent:FireServer(true, true)
  2343. end
  2344. if sound.TimePosition ~= 0 then
  2345. sound.TimePosition = 0
  2346. end
  2347. if not sound.IsPlaying then
  2348. sound.Playing = true
  2349. end
  2350. end;
  2351.  
  2352. Pause = function(sound)
  2353. if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
  2354. sound.CharacterSoundEvent:FireServer(false, false)
  2355. end
  2356. if sound.IsPlaying then
  2357. sound.Playing = false
  2358. end
  2359. end;
  2360.  
  2361. Resume = function(sound)
  2362. if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
  2363. sound.CharacterSoundEvent:FireServer(true, false)
  2364. end
  2365. if not sound.IsPlaying then
  2366. sound.Playing = true
  2367. end
  2368. end;
  2369.  
  2370. Stop = function(sound)
  2371. if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
  2372. sound.CharacterSoundEvent:FireServer(false, true)
  2373. end
  2374. if sound.IsPlaying then
  2375. sound.Playing = false
  2376. end
  2377. if sound.TimePosition ~= 0 then
  2378. sound.TimePosition = 0
  2379. end
  2380. end;
  2381. }
  2382.  
  2383. do
  2384. -- List of all active Looped sounds
  2385. local playingLoopedSounds = {}
  2386.  
  2387. -- Last seen Enum.HumanoidStateType
  2388. local activeState = nil
  2389.  
  2390. local fallSpeed = 0
  2391.  
  2392. -- Verify and set that "sound" is in "playingLoopedSounds".
  2393. function setSoundInPlayingLoopedSounds(sound)
  2394. for i=1, #playingLoopedSounds do
  2395. if playingLoopedSounds[i] == sound then
  2396. return
  2397. end
  2398. end
  2399. table.insert(playingLoopedSounds,sound)
  2400. end
  2401.  
  2402. -- Stop all active looped sounds except parameter "except". If "except" is not passed, all looped sounds will be stopped.
  2403. function stopPlayingLoopedSoundsExcept(except)
  2404. for i=#playingLoopedSounds,1,-1 do
  2405. if playingLoopedSounds[i] ~= except then
  2406. Util.Pause(playingLoopedSounds[i])
  2407. table.remove(playingLoopedSounds,i)
  2408. end
  2409. end
  2410. end
  2411.  
  2412. -- Table of Enum.HumanoidStateType to handling function
  2413. local stateUpdateHandler = {
  2414. [Enum.HumanoidStateType.Dead] = function()
  2415. stopPlayingLoopedSoundsExcept()
  2416. local sound = Sounds[SFX.Died]
  2417. Util.Play(sound)
  2418. end;
  2419.  
  2420. [Enum.HumanoidStateType.RunningNoPhysics] = function(speed)
  2421. stateUpdated(Enum.HumanoidStateType.Running, speed)
  2422. end;
  2423.  
  2424. [Enum.HumanoidStateType.Running] = function(speed)
  2425. local sound = Sounds[SFX.Running]
  2426. stopPlayingLoopedSoundsExcept(sound)
  2427.  
  2428. if(useUpdatedLocalSoundFlag and activeState == Enum.HumanoidStateType.Freefall and fallSpeed > 0.1) then
  2429. -- Play a landing sound if the character dropped from a large distance
  2430. local vol = math.min(1.0, math.max(0.0, (fallSpeed - 50) / 110))
  2431. local freeFallSound = Sounds[SFX.FreeFalling]
  2432. freeFallSound.Volume = vol
  2433. Util.Play(freeFallSound)
  2434. fallSpeed = 0
  2435. end
  2436. if useUpdatedLocalSoundFlag then
  2437. if speed ~= nil and speed > 0.5 then
  2438. Util.Resume(sound)
  2439. setSoundInPlayingLoopedSounds(sound)
  2440. elseif speed ~= nil then
  2441. stopPlayingLoopedSoundsExcept()
  2442. end
  2443. else
  2444. if Util.HorizontalSpeed(Head) > 0.5 then
  2445. Util.Resume(sound)
  2446. setSoundInPlayingLoopedSounds(sound)
  2447. else
  2448. stopPlayingLoopedSoundsExcept()
  2449. end
  2450. end
  2451. end;
  2452.  
  2453. [Enum.HumanoidStateType.Swimming] = function(speed)
  2454. local threshold
  2455. if useUpdatedLocalSoundFlag then threshold = speed else threshold = Util.VerticalSpeed(Head) end
  2456. if activeState ~= Enum.HumanoidStateType.Swimming and threshold > 0.1 then
  2457. local splashSound = Sounds[SFX.Splash]
  2458. splashSound.Volume = Util.Clamp(
  2459. Util.YForLineGivenXAndTwoPts(
  2460. Util.VerticalSpeed(Head),
  2461. 100, 0.28,
  2462. 350, 1),
  2463. 0,1)
  2464. Util.Play(splashSound)
  2465. end
  2466.  
  2467. do
  2468. local sound = Sounds[SFX.Swimming]
  2469. stopPlayingLoopedSoundsExcept(sound)
  2470. Util.Resume(sound)
  2471. setSoundInPlayingLoopedSounds(sound)
  2472. end
  2473. end;
  2474.  
  2475. [Enum.HumanoidStateType.Climbing] = function(speed)
  2476. local sound = Sounds[SFX.Climbing]
  2477. if useUpdatedLocalSoundFlag then
  2478. if speed ~= nil and math.abs(speed) > 0.1 then
  2479. Util.Resume(sound)
  2480. stopPlayingLoopedSoundsExcept(sound)
  2481. else
  2482. Util.Pause(sound)
  2483. stopPlayingLoopedSoundsExcept(sound)
  2484. end
  2485. else
  2486. if Util.VerticalSpeed(Head) > 0.1 then
  2487. Util.Resume(sound)
  2488. stopPlayingLoopedSoundsExcept(sound)
  2489. else
  2490. stopPlayingLoopedSoundsExcept()
  2491. end
  2492. end
  2493.  
  2494. setSoundInPlayingLoopedSounds(sound)
  2495. end;
  2496.  
  2497. [Enum.HumanoidStateType.Jumping] = function()
  2498. if activeState == Enum.HumanoidStateType.Jumping then
  2499. return
  2500. end
  2501. stopPlayingLoopedSoundsExcept()
  2502. local sound = Sounds[SFX.Jumping]
  2503. Util.Play(sound)
  2504. end;
  2505.  
  2506. [Enum.HumanoidStateType.GettingUp] = function()
  2507. stopPlayingLoopedSoundsExcept()
  2508. local sound = Sounds[SFX.GettingUp]
  2509. Util.Play(sound)
  2510. end;
  2511.  
  2512. [Enum.HumanoidStateType.Freefall] = function()
  2513. if activeState == Enum.HumanoidStateType.Freefall then
  2514. return
  2515. end
  2516. local sound = Sounds[SFX.FreeFalling]
  2517. sound.Volume = 0
  2518. stopPlayingLoopedSoundsExcept()
  2519.  
  2520. fallSpeed = math.max(fallSpeed, math.abs(Head.Velocity.y))
  2521. end;
  2522.  
  2523. [Enum.HumanoidStateType.FallingDown] = function()
  2524. stopPlayingLoopedSoundsExcept()
  2525. end;
  2526.  
  2527. [Enum.HumanoidStateType.Landed] = function()
  2528. stopPlayingLoopedSoundsExcept()
  2529. if Util.VerticalSpeed(Head) > 75 then
  2530. local landingSound = Sounds[SFX.Landing]
  2531. landingSound.Volume = Util.Clamp(
  2532. Util.YForLineGivenXAndTwoPts(
  2533. Util.VerticalSpeed(Head),
  2534. 50, 0,
  2535. 100, 1),
  2536. 0,1)
  2537. Util.Play(landingSound)
  2538. end
  2539. end;
  2540.  
  2541. [Enum.HumanoidStateType.Seated] = function()
  2542. stopPlayingLoopedSoundsExcept()
  2543. end;
  2544. }
  2545.  
  2546.  
  2547.  
  2548. -- Handle state event fired or OnChange fired
  2549. function stateUpdated(state, speed)
  2550. if stateUpdateHandler[state] ~= nil then
  2551. if useUpdatedLocalSoundFlag and (state == Enum.HumanoidStateType.Running
  2552. or state == Enum.HumanoidStateType.Climbing
  2553. or state == Enum.HumanoidStateType.Swimming
  2554. or state == Enum.HumanoidStateType.RunningNoPhysics) then
  2555. stateUpdateHandler[state](speed)
  2556. else
  2557. stateUpdateHandler[state]()
  2558. end
  2559. end
  2560. activeState = state
  2561. end
  2562.  
  2563. Humanoid.Died:connect( function() stateUpdated(Enum.HumanoidStateType.Dead) end)
  2564. Humanoid.Running:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Running, speed) end)
  2565. Humanoid.Swimming:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Swimming, speed) end)
  2566. Humanoid.Climbing:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Climbing, speed) end)
  2567. Humanoid.Jumping:connect( function() stateUpdated(Enum.HumanoidStateType.Jumping) end)
  2568. Humanoid.GettingUp:connect( function() stateUpdated(Enum.HumanoidStateType.GettingUp) end)
  2569. Humanoid.FreeFalling:connect( function() stateUpdated(Enum.HumanoidStateType.Freefall) end)
  2570. Humanoid.FallingDown:connect( function() stateUpdated(Enum.HumanoidStateType.FallingDown) end)
  2571.  
  2572.  
  2573.  
  2574. -- required for proper handling of Landed event
  2575.  
  2576. Humanoid.StateChanged:connect(function(old, new)
  2577. stateUpdated(new)
  2578. end)
  2579.  
  2580.  
  2581.  
  2582. function onUpdate(stepDeltaSeconds, tickSpeedSeconds)
  2583. local stepScale = stepDeltaSeconds / tickSpeedSeconds
  2584. do
  2585. local sound = Sounds[SFX.FreeFalling]
  2586. if activeState == Enum.HumanoidStateType.Freefall then
  2587. if Head.Velocity.Y < 0 and Util.VerticalSpeed(Head) > 75 then
  2588. Util.Resume(sound)
  2589.  
  2590. --Volume takes 1.1 seconds to go from volume 0 to 1
  2591. local ANIMATION_LENGTH_SECONDS = 1.1
  2592.  
  2593. local normalizedIncrement = tickSpeedSeconds / ANIMATION_LENGTH_SECONDS
  2594. sound.Volume = Util.Clamp(sound.Volume + normalizedIncrement * stepScale, 0, 1)
  2595. else
  2596. sound.Volume = 0
  2597. end
  2598. else
  2599. Util.Pause(sound)
  2600. end
  2601. end
  2602.  
  2603. do
  2604. local sound = Sounds[SFX.Running]
  2605. if activeState == Enum.HumanoidStateType.Running then
  2606. if Util.HorizontalSpeed(Head) < 0.5 then
  2607. Util.Pause(sound)
  2608. end
  2609. end
  2610. end
  2611. end
  2612.  
  2613.  
  2614. local lastTick = tick()
  2615. local TICK_SPEED_SECONDS = 0.25
  2616. while true do
  2617. onUpdate(tick() - lastTick,TICK_SPEED_SECONDS)
  2618. lastTick = tick()
  2619. wait(TICK_SPEED_SECONDS)
  2620. end
  2621.  
  2622. end
  2623.  
  2624. end))
  2625. Script131.Name = "Health"
  2626. Script131.Parent = Model98
  2627. table.insert(cors,sandbox(Script131,function()
  2628. -- Gradually regenerates the Humanoid's Health over time.
  2629.  
  2630. local REGEN_RATE = 1/100 -- Regenerate this fraction of MaxHealth per second.
  2631. local REGEN_STEP = 1 -- Wait this long between each regeneration step.
  2632.  
  2633. --------------------------------------------------------------------------------
  2634.  
  2635. local Character = script.Parent
  2636. local Humanoid = Character:WaitForChild'Humanoid'
  2637.  
  2638. --------------------------------------------------------------------------------
  2639.  
  2640. while true do
  2641. while Humanoid.Health < Humanoid.MaxHealth do
  2642. local dt = wait(REGEN_STEP)
  2643. local dh = dt*REGEN_RATE*Humanoid.MaxHealth
  2644. Humanoid.Health = math.min(Humanoid.Health + dh, Humanoid.MaxHealth)
  2645. end
  2646. Humanoid.HealthChanged:Wait()
  2647. end
  2648. end))
  2649. LocalScript132.Name = "Animate"
  2650. LocalScript132.Parent = Model98
  2651. table.insert(cors,sandbox(LocalScript132,function()
  2652. local Figure = script.Parent
  2653. local Torso = Figure:WaitForChild("Torso")
  2654. local RightShoulder = Torso:WaitForChild("Right Shoulder")
  2655. local LeftShoulder = Torso:WaitForChild("Left Shoulder")
  2656. local RightHip = Torso:WaitForChild("Right Hip")
  2657. local LeftHip = Torso:WaitForChild("Left Hip")
  2658. local Neck = Torso:WaitForChild("Neck")
  2659. local Humanoid = Figure:WaitForChild("Humanoid")
  2660. local pose = "Standing"
  2661.  
  2662. local currentAnim = ""
  2663. local currentAnimInstance = nil
  2664. local currentAnimTrack = nil
  2665. local currentAnimKeyframeHandler = nil
  2666. local currentAnimSpeed = 1.0
  2667. local animTable = {}
  2668. local animNames = {
  2669. idle = {
  2670. { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  2671. { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  2672. },
  2673. walk = {
  2674. { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  2675. },
  2676. run = {
  2677. { id = "run.xml", weight = 10 }
  2678. },
  2679. jump = {
  2680. { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  2681. },
  2682. fall = {
  2683. { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  2684. },
  2685. climb = {
  2686. { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  2687. },
  2688. sit = {
  2689. { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  2690. },
  2691. toolnone = {
  2692. { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  2693. },
  2694. toolslash = {
  2695. { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  2696. -- { id = "slash.xml", weight = 10 }
  2697. },
  2698. toollunge = {
  2699. { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  2700. },
  2701. wave = {
  2702. { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  2703. },
  2704. point = {
  2705. { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  2706. },
  2707. dance1 = {
  2708. { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  2709. { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  2710. { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  2711. },
  2712. dance2 = {
  2713. { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  2714. { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  2715. { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  2716. },
  2717. dance3 = {
  2718. { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  2719. { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  2720. { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  2721. },
  2722. laugh = {
  2723. { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  2724. },
  2725. cheer = {
  2726. { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  2727. },
  2728. }
  2729. local dances = {"dance1", "dance2", "dance3"}
  2730.  
  2731. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  2732. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  2733.  
  2734. function configureAnimationSet(name, fileList)
  2735. if (animTable[name] ~= nil) then
  2736. for _, connection in pairs(animTable[name].connections) do
  2737. connection:disconnect()
  2738. end
  2739. end
  2740. animTable[name] = {}
  2741. animTable[name].count = 0
  2742. animTable[name].totalWeight = 0
  2743. animTable[name].connections = {}
  2744.  
  2745. -- check for config values
  2746. local config = script:FindFirstChild(name)
  2747. if (config ~= nil) then
  2748. -- print("Loading anims " .. name)
  2749. table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  2750. table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  2751. local idx = 1
  2752. for _, childPart in pairs(config:GetChildren()) do
  2753. if (childPart:IsA("Animation")) then
  2754. table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  2755. animTable[name][idx] = {}
  2756. animTable[name][idx].anim = childPart
  2757. local weightObject = childPart:FindFirstChild("Weight")
  2758. if (weightObject == nil) then
  2759. animTable[name][idx].weight = 1
  2760. else
  2761. animTable[name][idx].weight = weightObject.Value
  2762. end
  2763. animTable[name].count = animTable[name].count + 1
  2764. animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  2765. -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  2766. idx = idx + 1
  2767. end
  2768. end
  2769. end
  2770.  
  2771. -- fallback to defaults
  2772. if (animTable[name].count <= 0) then
  2773. for idx, anim in pairs(fileList) do
  2774. animTable[name][idx] = {}
  2775. animTable[name][idx].anim = Instance.new("Animation")
  2776. animTable[name][idx].anim.Name = name
  2777. animTable[name][idx].anim.AnimationId = anim.id
  2778. animTable[name][idx].weight = anim.weight
  2779. animTable[name].count = animTable[name].count + 1
  2780. animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  2781. -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  2782. end
  2783. end
  2784. end
  2785.  
  2786. -- Setup animation objects
  2787. function scriptChildModified(child)
  2788. local fileList = animNames[child.Name]
  2789. if (fileList ~= nil) then
  2790. configureAnimationSet(child.Name, fileList)
  2791. end
  2792. end
  2793.  
  2794. script.ChildAdded:connect(scriptChildModified)
  2795. script.ChildRemoved:connect(scriptChildModified)
  2796.  
  2797.  
  2798. for name, fileList in pairs(animNames) do
  2799. configureAnimationSet(name, fileList)
  2800. end
  2801.  
  2802. -- ANIMATION
  2803.  
  2804. -- declarations
  2805. local toolAnim = "None"
  2806. local toolAnimTime = 0
  2807.  
  2808. local jumpAnimTime = 0
  2809. local jumpAnimDuration = 0.3
  2810.  
  2811. local toolTransitionTime = 0.1
  2812. local fallTransitionTime = 0.3
  2813. local jumpMaxLimbVelocity = 0.75
  2814.  
  2815. -- functions
  2816.  
  2817. function stopAllAnimations()
  2818. local oldAnim = currentAnim
  2819.  
  2820. -- return to idle if finishing an emote
  2821. if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  2822. oldAnim = "idle"
  2823. end
  2824.  
  2825. currentAnim = ""
  2826. currentAnimInstance = nil
  2827. if (currentAnimKeyframeHandler ~= nil) then
  2828. currentAnimKeyframeHandler:disconnect()
  2829. end
  2830.  
  2831. if (currentAnimTrack ~= nil) then
  2832. currentAnimTrack:Stop()
  2833. currentAnimTrack:Destroy()
  2834. currentAnimTrack = nil
  2835. end
  2836. return oldAnim
  2837. end
  2838.  
  2839. function setAnimationSpeed(speed)
  2840. if speed ~= currentAnimSpeed then
  2841. currentAnimSpeed = speed
  2842. currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  2843. end
  2844. end
  2845.  
  2846. function keyFrameReachedFunc(frameName)
  2847. if (frameName == "End") then
  2848.  
  2849. local repeatAnim = currentAnim
  2850. -- return to idle if finishing an emote
  2851. if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  2852. repeatAnim = "idle"
  2853. end
  2854.  
  2855. local animSpeed = currentAnimSpeed
  2856. playAnimation(repeatAnim, 0.0, Humanoid)
  2857. setAnimationSpeed(animSpeed)
  2858. end
  2859. end
  2860.  
  2861. -- Preload animations
  2862. function playAnimation(animName, transitionTime, humanoid)
  2863.  
  2864. local roll = math.random(1, animTable[animName].totalWeight)
  2865. local origRoll = roll
  2866. local idx = 1
  2867. while (roll > animTable[animName][idx].weight) do
  2868. roll = roll - animTable[animName][idx].weight
  2869. idx = idx + 1
  2870. end
  2871. -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  2872. local anim = animTable[animName][idx].anim
  2873.  
  2874. -- switch animation
  2875. if (anim ~= currentAnimInstance) then
  2876.  
  2877. if (currentAnimTrack ~= nil) then
  2878. currentAnimTrack:Stop(transitionTime)
  2879. currentAnimTrack:Destroy()
  2880. end
  2881.  
  2882. currentAnimSpeed = 1.0
  2883.  
  2884. -- load it to the humanoid; get AnimationTrack
  2885. currentAnimTrack = humanoid:LoadAnimation(anim)
  2886. currentAnimTrack.Priority = Enum.AnimationPriority.Core
  2887.  
  2888. -- play the animation
  2889. currentAnimTrack:Play(transitionTime)
  2890. currentAnim = animName
  2891. currentAnimInstance = anim
  2892.  
  2893. -- set up keyframe name triggers
  2894. if (currentAnimKeyframeHandler ~= nil) then
  2895. currentAnimKeyframeHandler:disconnect()
  2896. end
  2897. currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  2898.  
  2899. end
  2900.  
  2901. end
  2902.  
  2903. -------------------------------------------------------------------------------------------
  2904. -------------------------------------------------------------------------------------------
  2905.  
  2906. local toolAnimName = ""
  2907. local toolAnimTrack = nil
  2908. local toolAnimInstance = nil
  2909. local currentToolAnimKeyframeHandler = nil
  2910.  
  2911. function toolKeyFrameReachedFunc(frameName)
  2912. if (frameName == "End") then
  2913. -- print("Keyframe : ".. frameName)
  2914. playToolAnimation(toolAnimName, 0.0, Humanoid)
  2915. end
  2916. end
  2917.  
  2918.  
  2919. function playToolAnimation(animName, transitionTime, humanoid, priority)
  2920.  
  2921. local roll = math.random(1, animTable[animName].totalWeight)
  2922. local origRoll = roll
  2923. local idx = 1
  2924. while (roll > animTable[animName][idx].weight) do
  2925. roll = roll - animTable[animName][idx].weight
  2926. idx = idx + 1
  2927. end
  2928. -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  2929. local anim = animTable[animName][idx].anim
  2930.  
  2931. if (toolAnimInstance ~= anim) then
  2932.  
  2933. if (toolAnimTrack ~= nil) then
  2934. toolAnimTrack:Stop()
  2935. toolAnimTrack:Destroy()
  2936. transitionTime = 0
  2937. end
  2938.  
  2939. -- load it to the humanoid; get AnimationTrack
  2940. toolAnimTrack = humanoid:LoadAnimation(anim)
  2941. if priority then
  2942. toolAnimTrack.Priority = priority
  2943. end
  2944.  
  2945. -- play the animation
  2946. toolAnimTrack:Play(transitionTime)
  2947. toolAnimName = animName
  2948. toolAnimInstance = anim
  2949.  
  2950. currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  2951. end
  2952. end
  2953.  
  2954. function stopToolAnimations()
  2955. local oldAnim = toolAnimName
  2956.  
  2957. if (currentToolAnimKeyframeHandler ~= nil) then
  2958. currentToolAnimKeyframeHandler:disconnect()
  2959. end
  2960.  
  2961. toolAnimName = ""
  2962. toolAnimInstance = nil
  2963. if (toolAnimTrack ~= nil) then
  2964. toolAnimTrack:Stop()
  2965. toolAnimTrack:Destroy()
  2966. toolAnimTrack = nil
  2967. end
  2968.  
  2969.  
  2970. return oldAnim
  2971. end
  2972.  
  2973. -------------------------------------------------------------------------------------------
  2974. -------------------------------------------------------------------------------------------
  2975.  
  2976.  
  2977. function onRunning(speed)
  2978. if speed > 0.01 then
  2979. playAnimation("walk", 0.1, Humanoid)
  2980. if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  2981. setAnimationSpeed(speed / 14.5)
  2982. end
  2983. pose = "Running"
  2984. else
  2985. if emoteNames[currentAnim] == nil then
  2986. playAnimation("idle", 0.1, Humanoid)
  2987. pose = "Standing"
  2988. end
  2989. end
  2990. end
  2991.  
  2992. function onDied()
  2993. pose = "Dead"
  2994. end
  2995.  
  2996. function onJumping()
  2997. playAnimation("jump", 0.1, Humanoid)
  2998. jumpAnimTime = jumpAnimDuration
  2999. pose = "Jumping"
  3000. end
  3001.  
  3002. function onClimbing(speed)
  3003. playAnimation("climb", 0.1, Humanoid)
  3004. setAnimationSpeed(speed / 12.0)
  3005. pose = "Climbing"
  3006. end
  3007.  
  3008. function onGettingUp()
  3009. pose = "GettingUp"
  3010. end
  3011.  
  3012. function onFreeFall()
  3013. if (jumpAnimTime <= 0) then
  3014. playAnimation("fall", fallTransitionTime, Humanoid)
  3015. end
  3016. pose = "FreeFall"
  3017. end
  3018.  
  3019. function onFallingDown()
  3020. pose = "FallingDown"
  3021. end
  3022.  
  3023. function onSeated()
  3024. pose = "Seated"
  3025. end
  3026.  
  3027. function onPlatformStanding()
  3028. pose = "PlatformStanding"
  3029. end
  3030.  
  3031. function onSwimming(speed)
  3032. if speed > 0 then
  3033. pose = "Running"
  3034. else
  3035. pose = "Standing"
  3036. end
  3037. end
  3038.  
  3039. function getTool()
  3040. for _, kid in ipairs(Figure:GetChildren()) do
  3041. if kid.className == "Tool" then return kid end
  3042. end
  3043. return nil
  3044. end
  3045.  
  3046. function getToolAnim(tool)
  3047. for _, c in ipairs(tool:GetChildren()) do
  3048. if c.Name == "toolanim" and c.className == "StringValue" then
  3049. return c
  3050. end
  3051. end
  3052. return nil
  3053. end
  3054.  
  3055. function animateTool()
  3056.  
  3057. if (toolAnim == "None") then
  3058. playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
  3059. return
  3060. end
  3061.  
  3062. if (toolAnim == "Slash") then
  3063. playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
  3064. return
  3065. end
  3066.  
  3067. if (toolAnim == "Lunge") then
  3068. playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
  3069. return
  3070. end
  3071. end
  3072.  
  3073. function moveSit()
  3074. RightShoulder.MaxVelocity = 0.15
  3075. LeftShoulder.MaxVelocity = 0.15
  3076. RightShoulder:SetDesiredAngle(3.14 /2)
  3077. LeftShoulder:SetDesiredAngle(-3.14 /2)
  3078. RightHip:SetDesiredAngle(3.14 /2)
  3079. LeftHip:SetDesiredAngle(-3.14 /2)
  3080. end
  3081.  
  3082. local lastTick = 0
  3083.  
  3084. function move(time)
  3085. local amplitude = 1
  3086. local frequency = 1
  3087. local deltaTime = time - lastTick
  3088. lastTick = time
  3089.  
  3090. local climbFudge = 0
  3091. local setAngles = false
  3092.  
  3093. if (jumpAnimTime > 0) then
  3094. jumpAnimTime = jumpAnimTime - deltaTime
  3095. end
  3096.  
  3097. if (pose == "FreeFall" and jumpAnimTime <= 0) then
  3098. playAnimation("fall", fallTransitionTime, Humanoid)
  3099. elseif (pose == "Seated") then
  3100. playAnimation("sit", 0.5, Humanoid)
  3101. return
  3102. elseif (pose == "Running") then
  3103. playAnimation("walk", 0.1, Humanoid)
  3104. elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  3105. -- print("Wha " .. pose)
  3106. stopAllAnimations()
  3107. amplitude = 0.1
  3108. frequency = 1
  3109. setAngles = true
  3110. end
  3111.  
  3112. if (setAngles) then
  3113. local desiredAngle = amplitude * math.sin(time * frequency)
  3114.  
  3115. RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  3116. LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  3117. RightHip:SetDesiredAngle(-desiredAngle)
  3118. LeftHip:SetDesiredAngle(-desiredAngle)
  3119. end
  3120.  
  3121. -- Tool Animation handling
  3122. local tool = getTool()
  3123. if tool and tool:FindFirstChild("Handle") then
  3124.  
  3125. local animStringValueObject = getToolAnim(tool)
  3126.  
  3127. if animStringValueObject then
  3128. toolAnim = animStringValueObject.Value
  3129. -- message recieved, delete StringValue
  3130. animStringValueObject.Parent = nil
  3131. toolAnimTime = time + .3
  3132. end
  3133.  
  3134. if time > toolAnimTime then
  3135. toolAnimTime = 0
  3136. toolAnim = "None"
  3137. end
  3138.  
  3139. animateTool()
  3140. else
  3141. stopToolAnimations()
  3142. toolAnim = "None"
  3143. toolAnimInstance = nil
  3144. toolAnimTime = 0
  3145. end
  3146. end
  3147.  
  3148. -- connect events
  3149. Humanoid.Died:connect(onDied)
  3150. Humanoid.Running:connect(onRunning)
  3151. Humanoid.Jumping:connect(onJumping)
  3152. Humanoid.Climbing:connect(onClimbing)
  3153. Humanoid.GettingUp:connect(onGettingUp)
  3154. Humanoid.FreeFalling:connect(onFreeFall)
  3155. Humanoid.FallingDown:connect(onFallingDown)
  3156. Humanoid.Seated:connect(onSeated)
  3157. Humanoid.PlatformStanding:connect(onPlatformStanding)
  3158. Humanoid.Swimming:connect(onSwimming)
  3159.  
  3160. -- setup emote chat hook
  3161. game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
  3162. local emote = ""
  3163. if msg == "/e dance" then
  3164. emote = dances[math.random(1, #dances)]
  3165. elseif (string.sub(msg, 1, 3) == "/e ") then
  3166. emote = string.sub(msg, 4)
  3167. elseif (string.sub(msg, 1, 7) == "/emote ") then
  3168. emote = string.sub(msg, 8)
  3169. end
  3170.  
  3171. if (pose == "Standing" and emoteNames[emote] ~= nil) then
  3172. playAnimation(emote, 0.1, Humanoid)
  3173. end
  3174.  
  3175. end)
  3176.  
  3177.  
  3178. -- main program
  3179.  
  3180. -- initialize to idle
  3181. playAnimation("idle", 0.1, Humanoid)
  3182. pose = "Standing"
  3183.  
  3184. while Figure.Parent ~= nil do
  3185. local _, time = wait(0.1)
  3186. move(time)
  3187. end
  3188.  
  3189.  
  3190.  
  3191. end))
  3192. StringValue133.Name = "idle"
  3193. StringValue133.Parent = LocalScript132
  3194. Animation134.Name = "Animation1"
  3195. Animation134.Parent = StringValue133
  3196. Animation134.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  3197. NumberValue135.Name = "Weight"
  3198. NumberValue135.Parent = Animation134
  3199. NumberValue135.Value = 9
  3200. Animation136.Name = "Animation2"
  3201. Animation136.Parent = StringValue133
  3202. Animation136.AnimationId = "http://www.roblox.com/asset/?id=180435792"
  3203. NumberValue137.Name = "Weight"
  3204. NumberValue137.Parent = Animation136
  3205. NumberValue137.Value = 1
  3206. StringValue138.Name = "walk"
  3207. StringValue138.Parent = LocalScript132
  3208. Animation139.Name = "WalkAnim"
  3209. Animation139.Parent = StringValue138
  3210. Animation139.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  3211. StringValue140.Name = "run"
  3212. StringValue140.Parent = LocalScript132
  3213. Animation141.Name = "RunAnim"
  3214. Animation141.Parent = StringValue140
  3215. Animation141.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  3216. StringValue142.Name = "jump"
  3217. StringValue142.Parent = LocalScript132
  3218. Animation143.Name = "JumpAnim"
  3219. Animation143.Parent = StringValue142
  3220. Animation143.AnimationId = "http://www.roblox.com/asset/?id=125750702"
  3221. StringValue144.Name = "climb"
  3222. StringValue144.Parent = LocalScript132
  3223. Animation145.Name = "ClimbAnim"
  3224. Animation145.Parent = StringValue144
  3225. Animation145.AnimationId = "http://www.roblox.com/asset/?id=180436334"
  3226. StringValue146.Name = "toolnone"
  3227. StringValue146.Parent = LocalScript132
  3228. Animation147.Name = "ToolNoneAnim"
  3229. Animation147.Parent = StringValue146
  3230. Animation147.AnimationId = "http://www.roblox.com/asset/?id=182393478"
  3231. StringValue148.Name = "fall"
  3232. StringValue148.Parent = LocalScript132
  3233. Animation149.Name = "FallAnim"
  3234. Animation149.Parent = StringValue148
  3235. Animation149.AnimationId = "http://www.roblox.com/asset/?id=180436148"
  3236. StringValue150.Name = "sit"
  3237. StringValue150.Parent = LocalScript132
  3238. Animation151.Name = "SitAnim"
  3239. Animation151.Parent = StringValue150
  3240. Animation151.AnimationId = "http://www.roblox.com/asset/?id=178130996"
  3241. Shirt152.Name = "Shirt"
  3242. Shirt152.Parent = Model98
  3243. Shirt152.ShirtTemplate = "http://www.roblox.com/asset/?id=1476811227"
  3244. Accessory153.Name = "YoutubeHungryDino"
  3245. Accessory153.Parent = Model98
  3246. Accessory153.AttachmentPos = Vector3.new(0, -0.200000003, -0.349999994)
  3247. Part154.Name = "Handle"
  3248. Part154.Parent = Accessory153
  3249. Part154.Rotation = Vector3.new(-168.229996, 0, 0)
  3250. Part154.Anchored = true
  3251. Part154.CanCollide = false
  3252. Part154.Locked = true
  3253. Part154.FormFactor = Enum.FormFactor.Custom
  3254. Part154.Size = Vector3.new(1.39999962, 1.80000043, 2.00000024)
  3255. Part154.CFrame = CFrame.new(0, 7.88359451, -2.33357811, 1, 0, 0, 0, -0.978986144, 0.203927025, 0, -0.203927025, -0.978986144)
  3256. Part154.BottomSurface = Enum.SurfaceType.Smooth
  3257. Part154.TopSurface = Enum.SurfaceType.Smooth
  3258. Part154.Position = Vector3.new(0, 7.88359451, -2.33357811)
  3259. Part154.Orientation = Vector3.new(-11.7699995, 180, 180)
  3260. SpecialMesh155.Parent = Part154
  3261. SpecialMesh155.MeshId = "http://www.roblox.com/asset/?id=90817510"
  3262. SpecialMesh155.Scale = Vector3.new(0.850000024, 0.850000024, 0.850000024)
  3263. SpecialMesh155.TextureId = "rbxassetid://1469429662"
  3264. SpecialMesh155.MeshType = Enum.MeshType.FileMesh
  3265. SpecialMesh155.Scale = Vector3.new(0.850000024, 0.850000024, 0.850000024)
  3266. Vector3Value156.Name = "OriginalSize"
  3267. Vector3Value156.Parent = Part154
  3268. Vector3Value156.Value = Vector3.new(1.39999962, 1.80000043, 2.00000024)
  3269. Pants157.Name = "Pants"
  3270. Pants157.Parent = Model98
  3271. Pants157.PantsTemplate = "http://www.roblox.com/asset/?id=1476525797"
  3272. for i,v in pairs(mas:GetChildren()) do
  3273. v.Parent = game:GetService("Players").LocalPlayer.Character
  3274. pcall(function() v:MakeJoints() end)
  3275. end
  3276. mas:Destroy()
  3277. for i,v in pairs(cors) do
  3278. spawn(function()
  3279. pcall(v)
  3280. end)
  3281. end
Add Comment
Please, Sign In to add comment