Advertisement
giantgamingchannel

WorkableJoshie

Mar 23rd, 2018
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 51.82 KB | None | 0 0
  1. --By giantgamingchannel
  2. --Discord: Polandball (giant)#3166
  3.  
  4. function onKeyPress(inputObject, gameProcessedEvent)
  5.     if inputObject.KeyCode == Enum.KeyCode.Q then
  6. --Converted with ttyyuu12345's model to script plugin v4
  7. function sandbox(var,func)
  8.     local env = getfenv(func)
  9.     local newenv = setmetatable({},{
  10.         __index = function(self,k)
  11.             if k=="script" then
  12.                 return var
  13.             else
  14.                 return env[k]
  15.             end
  16.         end,
  17.     })
  18.     setfenv(func,newenv)
  19.     return func
  20. end
  21. cors = {}
  22. mas = Instance.new("Model",game:GetService("Lighting"))
  23. Model0 = Instance.new("Model")
  24. BodyColors1 = Instance.new("BodyColors")
  25. Shirt2 = Instance.new("Shirt")
  26. Script3 = Instance.new("Script")
  27. Humanoid4 = Instance.new("Humanoid")
  28. Accessory5 = Instance.new("Accessory")
  29. Part6 = Instance.new("Part")
  30. SpecialMesh7 = Instance.new("SpecialMesh")
  31. Attachment8 = Instance.new("Attachment")
  32. Vector3Value9 = Instance.new("Vector3Value")
  33. Weld10 = Instance.new("Weld")
  34. Script11 = Instance.new("Script")
  35. LocalScript12 = Instance.new("LocalScript")
  36. LocalScript13 = Instance.new("LocalScript")
  37. StringValue14 = Instance.new("StringValue")
  38. Animation15 = Instance.new("Animation")
  39. NumberValue16 = Instance.new("NumberValue")
  40. Animation17 = Instance.new("Animation")
  41. NumberValue18 = Instance.new("NumberValue")
  42. StringValue19 = Instance.new("StringValue")
  43. Animation20 = Instance.new("Animation")
  44. StringValue21 = Instance.new("StringValue")
  45. Animation22 = Instance.new("Animation")
  46. StringValue23 = Instance.new("StringValue")
  47. Animation24 = Instance.new("Animation")
  48. StringValue25 = Instance.new("StringValue")
  49. Animation26 = Instance.new("Animation")
  50. StringValue27 = Instance.new("StringValue")
  51. Animation28 = Instance.new("Animation")
  52. StringValue29 = Instance.new("StringValue")
  53. Animation30 = Instance.new("Animation")
  54. StringValue31 = Instance.new("StringValue")
  55. Animation32 = Instance.new("Animation")
  56. Part33 = Instance.new("Part")
  57. SpecialMesh34 = Instance.new("SpecialMesh")
  58. Decal35 = Instance.new("Decal")
  59. Attachment36 = Instance.new("Attachment")
  60. Attachment37 = Instance.new("Attachment")
  61. Attachment38 = Instance.new("Attachment")
  62. Attachment39 = Instance.new("Attachment")
  63. Sound40 = Instance.new("Sound")
  64. RemoteEvent41 = Instance.new("RemoteEvent")
  65. Sound42 = Instance.new("Sound")
  66. RemoteEvent43 = Instance.new("RemoteEvent")
  67. Sound44 = Instance.new("Sound")
  68. RemoteEvent45 = Instance.new("RemoteEvent")
  69. Sound46 = Instance.new("Sound")
  70. RemoteEvent47 = Instance.new("RemoteEvent")
  71. Sound48 = Instance.new("Sound")
  72. RemoteEvent49 = Instance.new("RemoteEvent")
  73. Sound50 = Instance.new("Sound")
  74. RemoteEvent51 = Instance.new("RemoteEvent")
  75. Sound52 = Instance.new("Sound")
  76. RemoteEvent53 = Instance.new("RemoteEvent")
  77. Sound54 = Instance.new("Sound")
  78. RemoteEvent55 = Instance.new("RemoteEvent")
  79. Sound56 = Instance.new("Sound")
  80. RemoteEvent57 = Instance.new("RemoteEvent")
  81. Part58 = Instance.new("Part")
  82. Attachment59 = Instance.new("Attachment")
  83. Motor6D60 = Instance.new("Motor6D")
  84. Part61 = Instance.new("Part")
  85. Attachment62 = Instance.new("Attachment")
  86. Attachment63 = Instance.new("Attachment")
  87. Part64 = Instance.new("Part")
  88. Attachment65 = Instance.new("Attachment")
  89. Part66 = Instance.new("Part")
  90. Attachment67 = Instance.new("Attachment")
  91. Attachment68 = Instance.new("Attachment")
  92. Part69 = Instance.new("Part")
  93. Attachment70 = Instance.new("Attachment")
  94. Part71 = Instance.new("Part")
  95. Decal72 = Instance.new("Decal")
  96. Attachment73 = Instance.new("Attachment")
  97. Attachment74 = Instance.new("Attachment")
  98. Attachment75 = Instance.new("Attachment")
  99. Attachment76 = Instance.new("Attachment")
  100. Attachment77 = Instance.new("Attachment")
  101. Attachment78 = Instance.new("Attachment")
  102. Attachment79 = Instance.new("Attachment")
  103. Attachment80 = Instance.new("Attachment")
  104. Motor6D81 = Instance.new("Motor6D")
  105. Motor6D82 = Instance.new("Motor6D")
  106. Motor6D83 = Instance.new("Motor6D")
  107. Motor6D84 = Instance.new("Motor6D")
  108. Motor6D85 = Instance.new("Motor6D")
  109. Model0.Name = "WorkableJoshie"
  110. Model0.Parent = mas
  111. BodyColors1.Parent = Model0
  112. BodyColors1.HeadColor = BrickColor.new("Pastel yellow")
  113. BodyColors1.LeftLegColor = BrickColor.new("Medium blue")
  114. BodyColors1.RightArmColor = BrickColor.new("Pastel yellow")
  115. BodyColors1.RightLegColor = BrickColor.new("Medium blue")
  116. BodyColors1.TorsoColor = BrickColor.new("Teal")
  117. Shirt2.Name = "Shirt"
  118. Shirt2.Parent = Model0
  119. Shirt2.ShirtTemplate = "http://www.roblox.com/asset/?id=227888194"
  120. Script3.Name = "Health"
  121. Script3.Parent = Model0
  122. table.insert(cors,sandbox(Script3,function()
  123. -- Gradually regenerates the Humanoid's Health over time.
  124.  
  125. local REGEN_RATE = 1/100 -- Regenerate this fraction of MaxHealth per second.
  126. local REGEN_STEP = 1 -- Wait this long between each regeneration step.
  127.  
  128. --------------------------------------------------------------------------------
  129.  
  130. local Character = script.Parent
  131. local Humanoid = Character:WaitForChild'Humanoid'
  132.  
  133. --------------------------------------------------------------------------------
  134.  
  135. while true do
  136.     while Humanoid.Health < Humanoid.MaxHealth do
  137.         local dt = wait(REGEN_STEP)
  138.         local dh = dt*REGEN_RATE*Humanoid.MaxHealth
  139.         Humanoid.Health = math.min(Humanoid.Health + dh, Humanoid.MaxHealth)
  140.     end
  141.     Humanoid.HealthChanged:Wait()
  142. end
  143. end))
  144. Humanoid4.Parent = Model0
  145. Humanoid4.RightLeg = Part69
  146. Humanoid4.LeftLeg = Part64
  147. Humanoid4.Torso = Part58
  148. Accessory5.Name = "Robloxclassicred"
  149. Accessory5.Parent = Model0
  150. Accessory5.AttachmentPos = Vector3.new(0, -0.0500000007, 0.100000001)
  151. Part6.Name = "Handle"
  152. Part6.Parent = Accessory5
  153. Part6.CanCollide = false
  154. Part6.Locked = true
  155. Part6.FormFactor = Enum.FormFactor.Symmetric
  156. Part6.Size = Vector3.new(1, 1, 2)
  157. Part6.CFrame = CFrame.new(-6, 5.04999924, -11.0997276, 1, -7.87137555e-09, 0, 7.87137555e-09, 1, 4.1444221e-16, -3.26223034e-24, -4.1444221e-16, 1)
  158. Part6.BottomSurface = Enum.SurfaceType.Smooth
  159. Part6.TopSurface = Enum.SurfaceType.Smooth
  160. Part6.Position = Vector3.new(-6, 5.04999924, -11.0997276)
  161. SpecialMesh7.Parent = Part6
  162. SpecialMesh7.MeshId = "http://www.roblox.com/asset/?id=46834172"
  163. SpecialMesh7.Scale = Vector3.new(1.04999995, 1.04999995, 1.04999995)
  164. SpecialMesh7.TextureId = "http://www.roblox.com/asset/?id=47991609"
  165. SpecialMesh7.MeshType = Enum.MeshType.FileMesh
  166. SpecialMesh7.Scale = Vector3.new(1.04999995, 1.04999995, 1.04999995)
  167. Attachment8.Name = "HatAttachment"
  168. Attachment8.Parent = Part6
  169. Attachment8.Rotation = Vector3.new(2.37457877e-14, -1.86912021e-22, -4.50996566e-07)
  170. Attachment8.CFrame = CFrame.new(8.65838956e-09, 0.0499997139, 0.0997277573, 1, 7.87137555e-09, -3.26223034e-24, -7.87137555e-09, 1, -4.1444221e-16, 0, 4.1444221e-16, 1)
  171. Attachment8.Position = Vector3.new(8.65838956e-09, 0.0499997139, 0.0997277573)
  172. Attachment8.Axis = Vector3.new(1, -7.87137555e-09, 0)
  173. Attachment8.Orientation = Vector3.new(2.37457877e-14, -1.86912021e-22, -4.50996566e-07)
  174. Vector3Value9.Name = "OriginalSize"
  175. Vector3Value9.Parent = Part6
  176. Vector3Value9.Value = Vector3.new(1, 1, 2)
  177. Weld10.Name = "AccessoryWeld"
  178. Weld10.Parent = Part6
  179. Weld10.C0 = CFrame.new(8.65838956e-09, 0.0499997139, 0.0997277573, 1, 7.87137555e-09, -3.26223034e-24, -7.87137555e-09, 1, -4.1444221e-16, 0, 4.1444221e-16, 1)
  180. Weld10.C1 = CFrame.new(0, 0.600000024, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  181. Weld10.Part0 = Part6
  182. Weld10.Part1 = Part33
  183. Script11.Name = "Sound"
  184. Script11.Parent = Model0
  185. table.insert(cors,sandbox(Script11,function()
  186. --[[
  187.     Author: @spotco
  188.     This script creates sounds which are placed under the character head.
  189.     These sounds are used by the "LocalSound" script.
  190.  
  191.     To modify this script, copy it to your "StarterPlayer/StarterCharacterScripts" folder keeping the same script name ("Sound").
  192.     The default Sound script loaded for every character will then be replaced with your copy of the script.
  193. ]]--
  194. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  195. local Players = game:GetService("Players")
  196.  
  197. local SOUND_EVENT_FOLDER_NAME = "DefaultSoundEvents"
  198. local DEFAULT_SERVER_SOUND_EVENT_NAME = "DefaultServerSoundEvent"
  199.  
  200. local SoundEventFolder = ReplicatedStorage:FindFirstChild(SOUND_EVENT_FOLDER_NAME)
  201. local DefaultServerSoundEvent = nil
  202.  
  203. local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
  204. if useSoundDispatcher then
  205.     if not SoundEventFolder then
  206.         SoundEventFolder = Instance.new("Folder")
  207.         SoundEventFolder.Name = SOUND_EVENT_FOLDER_NAME
  208.         SoundEventFolder.Archivable = false
  209.         SoundEventFolder.Parent = ReplicatedStorage
  210.     end
  211.  
  212.     DefaultServerSoundEvent = SoundEventFolder:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
  213. else
  214.     DefaultServerSoundEvent = ReplicatedStorage:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
  215. end
  216.  
  217. if not DefaultServerSoundEvent then
  218.     if useSoundDispatcher then
  219.         DefaultServerSoundEvent = Instance.new("RemoteEvent", SoundEventFolder)
  220.     else
  221.         DefaultServerSoundEvent = Instance.new("RemoteEvent", ReplicatedStorage)
  222.     end
  223.  
  224.     DefaultServerSoundEvent.Name = DEFAULT_SERVER_SOUND_EVENT_NAME
  225.     DefaultServerSoundEvent.OnServerEvent:Connect(function() end)
  226. end
  227.  
  228. local function CreateNewSound(name, id, looped, pitch, parent)
  229.     local sound = Instance.new("Sound")
  230.     sound.SoundId = id
  231.     sound.Name = name
  232.     sound.archivable = false
  233.     sound.Pitch = pitch
  234.     sound.Looped = looped
  235.     sound.MinDistance = 5
  236.     sound.MaxDistance = 150
  237.     sound.Volume = 0.65
  238.     sound.Parent = parent
  239.  
  240.     if DefaultServerSoundEvent then
  241.         local CharacterSoundEvent = Instance.new("RemoteEvent", sound)
  242.         CharacterSoundEvent.Name = "CharacterSoundEvent"
  243.         CharacterSoundEvent.OnServerEvent:Connect(function(player, playing, resetPosition)
  244.             if type(playing) ~= "boolean" then
  245.                 return
  246.             end
  247.             if type(resetPosition) ~= "boolean" then
  248.                 return
  249.             end
  250.  
  251.             if player.Character ~= script.Parent then
  252.                 return
  253.             end
  254.             for _, p in pairs(Players:GetPlayers()) do
  255.                 if p ~= player then
  256.                     -- Connect to the dispatcher to check if the player has loaded.
  257.                     if useSoundDispatcher then
  258.                         SoundEventFolder:FindFirstChild("SoundDispatcher"):Fire(p, sound, playing, resetPosition)
  259.                     else
  260.                         DefaultServerSoundEvent:FireClient(p, sound, playing, resetPosition)
  261.                     end
  262.                 end
  263.             end
  264.         end)
  265.     end
  266.     return sound
  267. end
  268.  
  269. local head = script.Parent:FindFirstChild("Head")
  270. if not head then
  271.     error("Sound script parent has no child Head.")
  272.     return
  273. end
  274.  
  275. CreateNewSound("GettingUp", "rbxasset://sounds/action_get_up.mp3", false, 1, head)
  276. CreateNewSound("Died", "rbxasset://sounds/uuhhh.mp3", false, 1, head)
  277. CreateNewSound("FreeFalling", "rbxasset://sounds/action_falling.mp3", true, 1, head)
  278. CreateNewSound("Jumping", "rbxasset://sounds/action_jump.mp3", false, 1, head)
  279. CreateNewSound("Landing", "rbxasset://sounds/action_jump_land.mp3", false, 1, head)
  280. CreateNewSound("Splash", "rbxasset://sounds/impact_water.mp3", false, 1, head)
  281. CreateNewSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1.85, head)
  282. CreateNewSound("Swimming", "rbxasset://sounds/action_swim.mp3", true, 1.6, head)
  283. CreateNewSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1, head)
  284. end))
  285. LocalScript12.Name = "LocalSound"
  286. LocalScript12.Parent = Script11
  287. table.insert(cors,sandbox(LocalScript12,function()
  288. --[[
  289.     Author: @spotco
  290.     This script runs locally for the player of the given humanoid.
  291.     This script triggers humanoid sound play/pause actions locally.
  292.  
  293.     The Playing/TimePosition properties of Sound objects bypass FilteringEnabled, so this triggers the sound
  294.     immediately for the player and is replicated to all other players.
  295.  
  296.     This script is optimized to reduce network traffic through minimizing the amount of property replication.
  297. ]]--
  298.  
  299. --All sounds are referenced by this ID
  300. local SFX = {
  301.     Died = 0;
  302.     Running = 1;
  303.     Swimming = 2;
  304.     Climbing = 3,
  305.     Jumping = 4;
  306.     GettingUp = 5;
  307.     FreeFalling = 6;
  308.     FallingDown = 7;
  309.     Landing = 8;
  310.     Splash = 9;
  311. }
  312.  
  313. local useUpdatedLocalSoundFlag = UserSettings():IsUserFeatureEnabled("UserFixCharacterSoundIssues")
  314.  
  315. local Humanoid = nil
  316. local Head = nil
  317. --SFX ID to Sound object
  318. local Sounds = {}
  319. local SoundService = game:GetService("SoundService")
  320. local soundEventFolderName = "DefaultSoundEvents"
  321. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  322. local AddCharacterLoadedEvent = nil
  323. local RemoveCharacterEvent = nil
  324. local soundEventFolder = ReplicatedStorage:FindFirstChild(soundEventFolderName)
  325. local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
  326.  
  327. if useSoundDispatcher then
  328.     if not soundEventFolder then
  329.         soundEventFolder = Instance.new("Folder", ReplicatedStorage)
  330.         soundEventFolder.Name = soundEventFolderName
  331.         soundEventFolder.Archivable = false
  332.     end
  333.    
  334.     -- Load the RemoveCharacterEvent
  335.     RemoveCharacterEvent = soundEventFolder:FindFirstChild("RemoveCharacterEvent")
  336.     if RemoveCharacterEvent == nil then
  337.         RemoveCharacterEvent = Instance.new("RemoteEvent", soundEventFolder)
  338.         RemoveCharacterEvent.Name = "RemoveCharacterEvent"
  339.     end
  340.  
  341.     AddCharacterLoadedEvent = soundEventFolder:FindFirstChild("AddCharacterLoadedEvent")
  342.     if AddCharacterLoadedEvent == nil then
  343.         AddCharacterLoadedEvent = Instance.new("RemoteEvent", soundEventFolder)
  344.         AddCharacterLoadedEvent.Name = "AddCharacterLoadedEvent"
  345.     end
  346.  
  347.     -- Notify the server a new character has been loaded
  348.     AddCharacterLoadedEvent:FireServer()
  349.  
  350.     -- Notify the sound dispatcher this character has left.
  351.     game.Players.LocalPlayer.CharacterRemoving:connect(function(character)
  352.         RemoveCharacterEvent:FireServer(game.Players.LocalPlayer)
  353.     end)
  354. end
  355.  
  356. do
  357.     local Figure = script.Parent.Parent
  358.     Head = Figure:WaitForChild("Head")
  359.     while not Humanoid do
  360.         for _,NewHumanoid in pairs(Figure:GetChildren()) do
  361.             if NewHumanoid:IsA("Humanoid") then
  362.                 Humanoid = NewHumanoid
  363.                 break
  364.             end
  365.         end
  366.         if Humanoid then break end
  367.         Figure.ChildAdded:wait()
  368.     end
  369.     Sounds[SFX.Died] =          Head:WaitForChild("Died")
  370.     Sounds[SFX.Running] =       Head:WaitForChild("Running")
  371.     Sounds[SFX.Swimming] =  Head:WaitForChild("Swimming")
  372.     Sounds[SFX.Climbing] =  Head:WaitForChild("Climbing")
  373.     Sounds[SFX.Jumping] =       Head:WaitForChild("Jumping")
  374.     Sounds[SFX.GettingUp] =     Head:WaitForChild("GettingUp")
  375.     Sounds[SFX.FreeFalling] =   Head:WaitForChild("FreeFalling")
  376.     Sounds[SFX.Landing] =       Head:WaitForChild("Landing")
  377.     Sounds[SFX.Splash] =        Head:WaitForChild("Splash")
  378.  
  379.     local DefaultServerSoundEvent = nil
  380.     if useSoundDispatcher then
  381.         DefaultServerSoundEvent = soundEventFolder:FindFirstChild("DefaultServerSoundEvent")
  382.     else
  383.         DefaultServerSoundEvent = game:GetService("ReplicatedStorage"):FindFirstChild("DefaultServerSoundEvent")
  384.     end
  385.  
  386.     if DefaultServerSoundEvent then
  387.         DefaultServerSoundEvent.OnClientEvent:connect(function(sound, playing, resetPosition)
  388.             if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") then
  389.                 if resetPosition and sound.TimePosition ~= 0 then
  390.                     sound.TimePosition = 0
  391.                 end
  392.                 if sound.IsPlaying ~= playing then
  393.                     sound.Playing = playing
  394.                 end
  395.             else
  396.                 if sound.TimePosition ~= 0 then
  397.                     sound.TimePosition = 0
  398.                 end
  399.                 if not sound.IsPlaying then
  400.                     sound.Playing = true
  401.                 end
  402.             end
  403.         end)
  404.     end
  405. end
  406.  
  407. local IsSoundFilteringEnabled = function()
  408.     return game.Workspace.FilteringEnabled and SoundService.RespectFilteringEnabled
  409. end
  410.  
  411. local Util
  412. Util = {
  413.  
  414.     --Define linear relationship between (pt1x,pt2x) and (pt2x,pt2y). Evaluate this at x.
  415.     YForLineGivenXAndTwoPts = function(x,pt1x,pt1y,pt2x,pt2y)
  416.         --(y - y1)/(x - x1) = m
  417.         local m = (pt1y - pt2y) / (pt1x - pt2x)
  418.         --float b = pt1.y - m * pt1.x;
  419.         local b = (pt1y - m * pt1x)
  420.         return m * x + b
  421.     end;
  422.  
  423.     --Clamps the value of "val" between the "min" and "max"
  424.     Clamp = function(val,min,max)
  425.         return math.min(max,math.max(min,val)) 
  426.     end;
  427.  
  428.     --Gets the horizontal (x,z) velocity magnitude of the given part
  429.     HorizontalSpeed = function(Head)
  430.         local hVel = Head.Velocity + Vector3.new(0,-Head.Velocity.Y,0)
  431.         return hVel.magnitude  
  432.     end;
  433.  
  434.     --Gets the vertical (y) velocity magnitude of the given part
  435.     VerticalSpeed = function(Head)
  436.         return math.abs(Head.Velocity.Y)
  437.     end;
  438.  
  439.     --Setting Playing/TimePosition values directly result in less network traffic than Play/Pause/Resume/Stop
  440.     --If these properties are enabled, use them.
  441.     Play = function(sound) 
  442.         if IsSoundFilteringEnabled() then
  443.             sound.CharacterSoundEvent:FireServer(true, true)
  444.         end
  445.         if sound.TimePosition ~= 0 then
  446.             sound.TimePosition = 0
  447.         end
  448.         if not sound.IsPlaying then
  449.             sound.Playing = true
  450.         end
  451.     end;
  452.  
  453.     Pause = function(sound)
  454.         if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
  455.             sound.CharacterSoundEvent:FireServer(false, false)
  456.         end
  457.         if sound.IsPlaying then
  458.             sound.Playing = false
  459.         end
  460.     end;
  461.  
  462.     Resume = function(sound)
  463.         if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
  464.             sound.CharacterSoundEvent:FireServer(true, false)
  465.         end
  466.         if not sound.IsPlaying then
  467.             sound.Playing = true
  468.         end
  469.     end;
  470.  
  471.     Stop = function(sound)
  472.         if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
  473.             sound.CharacterSoundEvent:FireServer(false, true)
  474.         end
  475.         if sound.IsPlaying then
  476.             sound.Playing = false
  477.         end
  478.         if sound.TimePosition ~= 0 then
  479.             sound.TimePosition = 0
  480.         end
  481.     end;
  482. }
  483.  
  484. do
  485.     -- List of all active Looped sounds
  486.     local playingLoopedSounds = {}
  487.  
  488.     -- Last seen Enum.HumanoidStateType
  489.     local activeState = nil
  490.  
  491.     local fallSpeed = 0
  492.  
  493.     -- Verify and set that "sound" is in "playingLoopedSounds".
  494.     function setSoundInPlayingLoopedSounds(sound)
  495.         for i=1, #playingLoopedSounds do
  496.             if playingLoopedSounds[i] == sound then
  497.                 return
  498.             end
  499.         end
  500.         table.insert(playingLoopedSounds,sound)
  501.     end
  502.  
  503.     -- Stop all active looped sounds except parameter "except". If "except" is not passed, all looped sounds will be stopped.
  504.     function stopPlayingLoopedSoundsExcept(except)
  505.         for i=#playingLoopedSounds,1,-1 do
  506.             if playingLoopedSounds[i] ~= except then
  507.                 Util.Pause(playingLoopedSounds[i])         
  508.                 table.remove(playingLoopedSounds,i)
  509.             end
  510.         end
  511.     end
  512.  
  513.     -- Table of Enum.HumanoidStateType to handling function
  514.     local stateUpdateHandler = {
  515.         [Enum.HumanoidStateType.Dead] = function()
  516.             stopPlayingLoopedSoundsExcept()
  517.             local sound = Sounds[SFX.Died]
  518.             Util.Play(sound)
  519.         end;
  520.  
  521.         [Enum.HumanoidStateType.RunningNoPhysics] = function(speed)
  522.             stateUpdated(Enum.HumanoidStateType.Running, speed)
  523.         end;
  524.  
  525.         [Enum.HumanoidStateType.Running] = function(speed) 
  526.             local sound = Sounds[SFX.Running]
  527.             stopPlayingLoopedSoundsExcept(sound)
  528.  
  529.             if(useUpdatedLocalSoundFlag and activeState == Enum.HumanoidStateType.Freefall and fallSpeed > 0.1) then
  530.                 -- Play a landing sound if the character dropped from a large distance
  531.                 local vol = math.min(1.0, math.max(0.0, (fallSpeed - 50) / 110))
  532.                 local freeFallSound = Sounds[SFX.FreeFalling]
  533.                 freeFallSound.Volume = vol
  534.                 Util.Play(freeFallSound)
  535.                 fallSpeed = 0
  536.             end
  537.             if useUpdatedLocalSoundFlag then
  538.                 if speed ~= nil and speed > 0.5 then
  539.                     Util.Resume(sound)
  540.                     setSoundInPlayingLoopedSounds(sound)
  541.                 elseif speed ~= nil then
  542.                     stopPlayingLoopedSoundsExcept()
  543.                 end
  544.             else
  545.                 if Util.HorizontalSpeed(Head) > 0.5 then
  546.                     Util.Resume(sound)
  547.                     setSoundInPlayingLoopedSounds(sound)
  548.                 else
  549.                     stopPlayingLoopedSoundsExcept()
  550.                 end
  551.             end
  552.         end;
  553.  
  554.         [Enum.HumanoidStateType.Swimming] = function(speed)
  555.         local threshold
  556.         if useUpdatedLocalSoundFlag then threshold = speed else threshold = Util.VerticalSpeed(Head) end
  557.             if activeState ~= Enum.HumanoidStateType.Swimming and threshold > 0.1 then
  558.                 local splashSound = Sounds[SFX.Splash]
  559.                 splashSound.Volume = Util.Clamp(
  560.                     Util.YForLineGivenXAndTwoPts(
  561.                         Util.VerticalSpeed(Head),
  562.                         100, 0.28,
  563.                         350, 1),
  564.                     0,1)
  565.                 Util.Play(splashSound)
  566.             end
  567.  
  568.             do
  569.                 local sound = Sounds[SFX.Swimming]
  570.                 stopPlayingLoopedSoundsExcept(sound)
  571.                 Util.Resume(sound)
  572.                 setSoundInPlayingLoopedSounds(sound)
  573.             end
  574.         end;
  575.  
  576.         [Enum.HumanoidStateType.Climbing] = function(speed)
  577.             local sound = Sounds[SFX.Climbing]
  578.             if useUpdatedLocalSoundFlag then
  579.                 if speed ~= nil and math.abs(speed) > 0.1 then
  580.                     Util.Resume(sound)
  581.                     stopPlayingLoopedSoundsExcept(sound)
  582.                 else
  583.                     Util.Pause(sound)
  584.                     stopPlayingLoopedSoundsExcept(sound)
  585.                 end    
  586.             else
  587.                 if Util.VerticalSpeed(Head) > 0.1 then
  588.                     Util.Resume(sound)
  589.                     stopPlayingLoopedSoundsExcept(sound)
  590.                 else
  591.                     stopPlayingLoopedSoundsExcept()
  592.                 end
  593.             end
  594.  
  595.             setSoundInPlayingLoopedSounds(sound)
  596.         end;
  597.  
  598.         [Enum.HumanoidStateType.Jumping] = function()
  599.             if activeState == Enum.HumanoidStateType.Jumping then
  600.                 return
  601.             end    
  602.             stopPlayingLoopedSoundsExcept()
  603.             local sound = Sounds[SFX.Jumping]
  604.             Util.Play(sound)
  605.         end;
  606.  
  607.         [Enum.HumanoidStateType.GettingUp] = function()
  608.             stopPlayingLoopedSoundsExcept()
  609.             local sound = Sounds[SFX.GettingUp]
  610.             Util.Play(sound)
  611.         end;
  612.  
  613.         [Enum.HumanoidStateType.Freefall] = function()
  614.             if activeState == Enum.HumanoidStateType.Freefall then
  615.                 return
  616.             end
  617.             local sound = Sounds[SFX.FreeFalling]
  618.             sound.Volume = 0
  619.             stopPlayingLoopedSoundsExcept()
  620.  
  621.             fallSpeed = math.max(fallSpeed, math.abs(Head.Velocity.y))
  622.         end;
  623.  
  624.         [Enum.HumanoidStateType.FallingDown] = function()
  625.             stopPlayingLoopedSoundsExcept()
  626.         end;
  627.  
  628.         [Enum.HumanoidStateType.Landed] = function()
  629.             stopPlayingLoopedSoundsExcept()
  630.             if Util.VerticalSpeed(Head) > 75 then
  631.                 local landingSound = Sounds[SFX.Landing]
  632.                 landingSound.Volume = Util.Clamp(
  633.                     Util.YForLineGivenXAndTwoPts(
  634.                         Util.VerticalSpeed(Head),
  635.                         50, 0,
  636.                         100, 1),
  637.                     0,1)
  638.                 Util.Play(landingSound)        
  639.             end
  640.         end;
  641.  
  642.         [Enum.HumanoidStateType.Seated] = function()
  643.             stopPlayingLoopedSoundsExcept()
  644.         end;   
  645.     }
  646.  
  647.    
  648.  
  649.     -- Handle state event fired or OnChange fired
  650.     function stateUpdated(state, speed)
  651.         if stateUpdateHandler[state] ~= nil then
  652.             if useUpdatedLocalSoundFlag and (state == Enum.HumanoidStateType.Running
  653.                 or state == Enum.HumanoidStateType.Climbing
  654.                 or state == Enum.HumanoidStateType.Swimming
  655.                 or state == Enum.HumanoidStateType.RunningNoPhysics) then
  656.                 stateUpdateHandler[state](speed)
  657.             else
  658.                 stateUpdateHandler[state]()
  659.             end
  660.         end
  661.         activeState = state
  662.     end
  663.  
  664.     Humanoid.Died:connect(          function() stateUpdated(Enum.HumanoidStateType.Dead)            end)
  665.     Humanoid.Running:connect(       function(speed) stateUpdated(Enum.HumanoidStateType.Running, speed) end)
  666.     Humanoid.Swimming:connect(      function(speed) stateUpdated(Enum.HumanoidStateType.Swimming, speed) end)
  667.     Humanoid.Climbing:connect(      function(speed) stateUpdated(Enum.HumanoidStateType.Climbing, speed) end)
  668.     Humanoid.Jumping:connect(       function() stateUpdated(Enum.HumanoidStateType.Jumping)         end)
  669.     Humanoid.GettingUp:connect(     function() stateUpdated(Enum.HumanoidStateType.GettingUp)       end)
  670.     Humanoid.FreeFalling:connect(   function() stateUpdated(Enum.HumanoidStateType.Freefall)        end)
  671.     Humanoid.FallingDown:connect(   function() stateUpdated(Enum.HumanoidStateType.FallingDown)     end)
  672.  
  673.    
  674.  
  675.     -- required for proper handling of Landed event
  676.  
  677.     Humanoid.StateChanged:connect(function(old, new)
  678.         stateUpdated(new)
  679.     end)
  680.  
  681.    
  682.  
  683.     function onUpdate(stepDeltaSeconds, tickSpeedSeconds)
  684.         local stepScale = stepDeltaSeconds / tickSpeedSeconds
  685.         do
  686.             local sound = Sounds[SFX.FreeFalling]
  687.             if activeState == Enum.HumanoidStateType.Freefall then
  688.                 if Head.Velocity.Y < 0 and Util.VerticalSpeed(Head) > 75 then
  689.                     Util.Resume(sound)
  690.  
  691.                     --Volume takes 1.1 seconds to go from volume 0 to 1
  692.                     local ANIMATION_LENGTH_SECONDS = 1.1
  693.  
  694.                     local normalizedIncrement = tickSpeedSeconds / ANIMATION_LENGTH_SECONDS                                
  695.                     sound.Volume = Util.Clamp(sound.Volume + normalizedIncrement * stepScale, 0, 1)
  696.                 else
  697.                     sound.Volume = 0
  698.                 end        
  699.             else
  700.                 Util.Pause(sound)
  701.             end
  702.         end
  703.  
  704.         do
  705.             local sound = Sounds[SFX.Running]
  706.             if activeState == Enum.HumanoidStateType.Running then
  707.                 if Util.HorizontalSpeed(Head) < 0.5 then
  708.                     Util.Pause(sound)
  709.                 end
  710.             end
  711.         end    
  712.     end
  713.  
  714.    
  715.     local lastTick = tick()
  716.     local TICK_SPEED_SECONDS = 0.25
  717.     while true do
  718.         onUpdate(tick() - lastTick,TICK_SPEED_SECONDS)
  719.         lastTick = tick()
  720.         wait(TICK_SPEED_SECONDS)
  721.     end
  722.  
  723. end
  724.  
  725. end))
  726. LocalScript13.Name = "Animate"
  727. LocalScript13.Parent = Model0
  728. table.insert(cors,sandbox(LocalScript13,function()
  729. local Figure = script.Parent
  730. local Torso = Figure:WaitForChild("Torso")
  731. local RightShoulder = Torso:WaitForChild("Right Shoulder")
  732. local LeftShoulder = Torso:WaitForChild("Left Shoulder")
  733. local RightHip = Torso:WaitForChild("Right Hip")
  734. local LeftHip = Torso:WaitForChild("Left Hip")
  735. local Neck = Torso:WaitForChild("Neck")
  736. local Humanoid = Figure:WaitForChild("Humanoid")
  737. local pose = "Standing"
  738.  
  739. local currentAnim = ""
  740. local currentAnimInstance = nil
  741. local currentAnimTrack = nil
  742. local currentAnimKeyframeHandler = nil
  743. local currentAnimSpeed = 1.0
  744. local animTable = {}
  745. local animNames = {
  746.     idle =  {  
  747.                 { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
  748.                 { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
  749.             },
  750.     walk =  {  
  751.                 { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
  752.             },
  753.     run =   {
  754.                 { id = "run.xml", weight = 10 }
  755.             },
  756.     jump =  {
  757.                 { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
  758.             },
  759.     fall =  {
  760.                 { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
  761.             },
  762.     climb = {
  763.                 { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
  764.             },
  765.     sit =   {
  766.                 { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
  767.             }, 
  768.     toolnone = {
  769.                 { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
  770.             },
  771.     toolslash = {
  772.                 { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
  773. --              { id = "slash.xml", weight = 10 }
  774.             },
  775.     toollunge = {
  776.                 { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
  777.             },
  778.     wave = {
  779.                 { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
  780.             },
  781.     point = {
  782.                 { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
  783.             },
  784.     dance1 = {
  785.                 { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
  786.                 { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
  787.                 { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
  788.             },
  789.     dance2 = {
  790.                 { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
  791.                 { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
  792.                 { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
  793.             },
  794.     dance3 = {
  795.                 { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
  796.                 { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
  797.                 { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
  798.             },
  799.     laugh = {
  800.                 { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
  801.             },
  802.     cheer = {
  803.                 { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
  804.             },
  805. }
  806. local dances = {"dance1", "dance2", "dance3"}
  807.  
  808. -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
  809. local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
  810.  
  811. function configureAnimationSet(name, fileList)
  812.     if (animTable[name] ~= nil) then
  813.         for _, connection in pairs(animTable[name].connections) do
  814.             connection:disconnect()
  815.         end
  816.     end
  817.     animTable[name] = {}
  818.     animTable[name].count = 0
  819.     animTable[name].totalWeight = 0
  820.     animTable[name].connections = {}
  821.  
  822.     -- check for config values
  823.     local config = script:FindFirstChild(name)
  824.     if (config ~= nil) then
  825. --      print("Loading anims " .. name)
  826.         table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
  827.         table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
  828.         local idx = 1
  829.         for _, childPart in pairs(config:GetChildren()) do
  830.             if (childPart:IsA("Animation")) then
  831.                 table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
  832.                 animTable[name][idx] = {}
  833.                 animTable[name][idx].anim = childPart
  834.                 local weightObject = childPart:FindFirstChild("Weight")
  835.                 if (weightObject == nil) then
  836.                     animTable[name][idx].weight = 1
  837.                 else
  838.                     animTable[name][idx].weight = weightObject.Value
  839.                 end
  840.                 animTable[name].count = animTable[name].count + 1
  841.                 animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
  842.     --          print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
  843.                 idx = idx + 1
  844.             end
  845.         end
  846.     end
  847.  
  848.     -- fallback to defaults
  849.     if (animTable[name].count <= 0) then
  850.         for idx, anim in pairs(fileList) do
  851.             animTable[name][idx] = {}
  852.             animTable[name][idx].anim = Instance.new("Animation")
  853.             animTable[name][idx].anim.Name = name
  854.             animTable[name][idx].anim.AnimationId = anim.id
  855.             animTable[name][idx].weight = anim.weight
  856.             animTable[name].count = animTable[name].count + 1
  857.             animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
  858. --          print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
  859.         end
  860.     end
  861. end
  862.  
  863. -- Setup animation objects
  864. function scriptChildModified(child)
  865.     local fileList = animNames[child.Name]
  866.     if (fileList ~= nil) then
  867.         configureAnimationSet(child.Name, fileList)
  868.     end
  869. end
  870.  
  871. script.ChildAdded:connect(scriptChildModified)
  872. script.ChildRemoved:connect(scriptChildModified)
  873.  
  874.  
  875. for name, fileList in pairs(animNames) do
  876.     configureAnimationSet(name, fileList)
  877. end
  878.  
  879. -- ANIMATION
  880.  
  881. -- declarations
  882. local toolAnim = "None"
  883. local toolAnimTime = 0
  884.  
  885. local jumpAnimTime = 0
  886. local jumpAnimDuration = 0.3
  887.  
  888. local toolTransitionTime = 0.1
  889. local fallTransitionTime = 0.3
  890. local jumpMaxLimbVelocity = 0.75
  891.  
  892. -- functions
  893.  
  894. function stopAllAnimations()
  895.     local oldAnim = currentAnim
  896.  
  897.     -- return to idle if finishing an emote
  898.     if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
  899.         oldAnim = "idle"
  900.     end
  901.  
  902.     currentAnim = ""
  903.     currentAnimInstance = nil
  904.     if (currentAnimKeyframeHandler ~= nil) then
  905.         currentAnimKeyframeHandler:disconnect()
  906.     end
  907.  
  908.     if (currentAnimTrack ~= nil) then
  909.         currentAnimTrack:Stop()
  910.         currentAnimTrack:Destroy()
  911.         currentAnimTrack = nil
  912.     end
  913.     return oldAnim
  914. end
  915.  
  916. function setAnimationSpeed(speed)
  917.     if speed ~= currentAnimSpeed then
  918.         currentAnimSpeed = speed
  919.         currentAnimTrack:AdjustSpeed(currentAnimSpeed)
  920.     end
  921. end
  922.  
  923. function keyFrameReachedFunc(frameName)
  924.     if (frameName == "End") then
  925.  
  926.         local repeatAnim = currentAnim
  927.         -- return to idle if finishing an emote
  928.         if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
  929.             repeatAnim = "idle"
  930.         end
  931.        
  932.         local animSpeed = currentAnimSpeed
  933.         playAnimation(repeatAnim, 0.0, Humanoid)
  934.         setAnimationSpeed(animSpeed)
  935.     end
  936. end
  937.  
  938. -- Preload animations
  939. function playAnimation(animName, transitionTime, humanoid)
  940.        
  941.     local roll = math.random(1, animTable[animName].totalWeight)
  942.     local origRoll = roll
  943.     local idx = 1
  944.     while (roll > animTable[animName][idx].weight) do
  945.         roll = roll - animTable[animName][idx].weight
  946.         idx = idx + 1
  947.     end
  948. --      print(animName .. " " .. idx .. " [" .. origRoll .. "]")
  949.     local anim = animTable[animName][idx].anim
  950.  
  951.     -- switch animation    
  952.     if (anim ~= currentAnimInstance) then
  953.        
  954.         if (currentAnimTrack ~= nil) then
  955.             currentAnimTrack:Stop(transitionTime)
  956.             currentAnimTrack:Destroy()
  957.         end
  958.  
  959.         currentAnimSpeed = 1.0
  960.    
  961.         -- load it to the humanoid; get AnimationTrack
  962.         currentAnimTrack = humanoid:LoadAnimation(anim)
  963.         currentAnimTrack.Priority = Enum.AnimationPriority.Core
  964.          
  965.         -- play the animation
  966.         currentAnimTrack:Play(transitionTime)
  967.         currentAnim = animName
  968.         currentAnimInstance = anim
  969.  
  970.         -- set up keyframe name triggers
  971.         if (currentAnimKeyframeHandler ~= nil) then
  972.             currentAnimKeyframeHandler:disconnect()
  973.         end
  974.         currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
  975.        
  976.     end
  977.  
  978. end
  979.  
  980. -------------------------------------------------------------------------------------------
  981. -------------------------------------------------------------------------------------------
  982.  
  983. local toolAnimName = ""
  984. local toolAnimTrack = nil
  985. local toolAnimInstance = nil
  986. local currentToolAnimKeyframeHandler = nil
  987.  
  988. function toolKeyFrameReachedFunc(frameName)
  989.     if (frameName == "End") then
  990. --      print("Keyframe : ".. frameName)   
  991.         playToolAnimation(toolAnimName, 0.0, Humanoid)
  992.     end
  993. end
  994.  
  995.  
  996. function playToolAnimation(animName, transitionTime, humanoid, priority)     
  997.        
  998.         local roll = math.random(1, animTable[animName].totalWeight)
  999.         local origRoll = roll
  1000.         local idx = 1
  1001.         while (roll > animTable[animName][idx].weight) do
  1002.             roll = roll - animTable[animName][idx].weight
  1003.             idx = idx + 1
  1004.         end
  1005. --      print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
  1006.         local anim = animTable[animName][idx].anim
  1007.  
  1008.         if (toolAnimInstance ~= anim) then
  1009.            
  1010.             if (toolAnimTrack ~= nil) then
  1011.                 toolAnimTrack:Stop()
  1012.                 toolAnimTrack:Destroy()
  1013.                 transitionTime = 0
  1014.             end
  1015.                    
  1016.             -- load it to the humanoid; get AnimationTrack
  1017.             toolAnimTrack = humanoid:LoadAnimation(anim)
  1018.             if priority then
  1019.                 toolAnimTrack.Priority = priority
  1020.             end
  1021.              
  1022.             -- play the animation
  1023.             toolAnimTrack:Play(transitionTime)
  1024.             toolAnimName = animName
  1025.             toolAnimInstance = anim
  1026.  
  1027.             currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
  1028.         end
  1029. end
  1030.  
  1031. function stopToolAnimations()
  1032.     local oldAnim = toolAnimName
  1033.  
  1034.     if (currentToolAnimKeyframeHandler ~= nil) then
  1035.         currentToolAnimKeyframeHandler:disconnect()
  1036.     end
  1037.  
  1038.     toolAnimName = ""
  1039.     toolAnimInstance = nil
  1040.     if (toolAnimTrack ~= nil) then
  1041.         toolAnimTrack:Stop()
  1042.         toolAnimTrack:Destroy()
  1043.         toolAnimTrack = nil
  1044.     end
  1045.  
  1046.  
  1047.     return oldAnim
  1048. end
  1049.  
  1050. -------------------------------------------------------------------------------------------
  1051. -------------------------------------------------------------------------------------------
  1052.  
  1053.  
  1054. function onRunning(speed)
  1055.     if speed > 0.01 then
  1056.         playAnimation("walk", 0.1, Humanoid)
  1057.         if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
  1058.             setAnimationSpeed(speed / 14.5)
  1059.         end
  1060.         pose = "Running"
  1061.     else
  1062.         if emoteNames[currentAnim] == nil then
  1063.             playAnimation("idle", 0.1, Humanoid)
  1064.             pose = "Standing"
  1065.         end
  1066.     end
  1067. end
  1068.  
  1069. function onDied()
  1070.     pose = "Dead"
  1071. end
  1072.  
  1073. function onJumping()
  1074.     playAnimation("jump", 0.1, Humanoid)
  1075.     jumpAnimTime = jumpAnimDuration
  1076.     pose = "Jumping"
  1077. end
  1078.  
  1079. function onClimbing(speed)
  1080.     playAnimation("climb", 0.1, Humanoid)
  1081.     setAnimationSpeed(speed / 12.0)
  1082.     pose = "Climbing"
  1083. end
  1084.  
  1085. function onGettingUp()
  1086.     pose = "GettingUp"
  1087. end
  1088.  
  1089. function onFreeFall()
  1090.     if (jumpAnimTime <= 0) then
  1091.         playAnimation("fall", fallTransitionTime, Humanoid)
  1092.     end
  1093.     pose = "FreeFall"
  1094. end
  1095.  
  1096. function onFallingDown()
  1097.     pose = "FallingDown"
  1098. end
  1099.  
  1100. function onSeated()
  1101.     pose = "Seated"
  1102. end
  1103.  
  1104. function onPlatformStanding()
  1105.     pose = "PlatformStanding"
  1106. end
  1107.  
  1108. function onSwimming(speed)
  1109.     if speed > 0 then
  1110.         pose = "Running"
  1111.     else
  1112.         pose = "Standing"
  1113.     end
  1114. end
  1115.  
  1116. function getTool() 
  1117.     for _, kid in ipairs(Figure:GetChildren()) do
  1118.         if kid.className == "Tool" then return kid end
  1119.     end
  1120.     return nil
  1121. end
  1122.  
  1123. function getToolAnim(tool)
  1124.     for _, c in ipairs(tool:GetChildren()) do
  1125.         if c.Name == "toolanim" and c.className == "StringValue" then
  1126.             return c
  1127.         end
  1128.     end
  1129.     return nil
  1130. end
  1131.  
  1132. function animateTool()
  1133.    
  1134.     if (toolAnim == "None") then
  1135.         playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
  1136.         return
  1137.     end
  1138.  
  1139.     if (toolAnim == "Slash") then
  1140.         playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
  1141.         return
  1142.     end
  1143.  
  1144.     if (toolAnim == "Lunge") then
  1145.         playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
  1146.         return
  1147.     end
  1148. end
  1149.  
  1150. function moveSit()
  1151.     RightShoulder.MaxVelocity = 0.15
  1152.     LeftShoulder.MaxVelocity = 0.15
  1153.     RightShoulder:SetDesiredAngle(3.14 /2)
  1154.     LeftShoulder:SetDesiredAngle(-3.14 /2)
  1155.     RightHip:SetDesiredAngle(3.14 /2)
  1156.     LeftHip:SetDesiredAngle(-3.14 /2)
  1157. end
  1158.  
  1159. local lastTick = 0
  1160.  
  1161. function move(time)
  1162.     local amplitude = 1
  1163.     local frequency = 1
  1164.     local deltaTime = time - lastTick
  1165.     lastTick = time
  1166.  
  1167.     local climbFudge = 0
  1168.     local setAngles = false
  1169.  
  1170.     if (jumpAnimTime > 0) then
  1171.         jumpAnimTime = jumpAnimTime - deltaTime
  1172.     end
  1173.  
  1174.     if (pose == "FreeFall" and jumpAnimTime <= 0) then
  1175.         playAnimation("fall", fallTransitionTime, Humanoid)
  1176.     elseif (pose == "Seated") then
  1177.         playAnimation("sit", 0.5, Humanoid)
  1178.         return
  1179.     elseif (pose == "Running") then
  1180.         playAnimation("walk", 0.1, Humanoid)
  1181.     elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
  1182. --      print("Wha " .. pose)
  1183.         stopAllAnimations()
  1184.         amplitude = 0.1
  1185.         frequency = 1
  1186.         setAngles = true
  1187.     end
  1188.  
  1189.     if (setAngles) then
  1190.         local desiredAngle = amplitude * math.sin(time * frequency)
  1191.  
  1192.         RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
  1193.         LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
  1194.         RightHip:SetDesiredAngle(-desiredAngle)
  1195.         LeftHip:SetDesiredAngle(-desiredAngle)
  1196.     end
  1197.  
  1198.     -- Tool Animation handling
  1199.     local tool = getTool()
  1200.     if tool and tool:FindFirstChild("Handle") then
  1201.    
  1202.         local animStringValueObject = getToolAnim(tool)
  1203.  
  1204.         if animStringValueObject then
  1205.             toolAnim = animStringValueObject.Value
  1206.             -- message recieved, delete StringValue
  1207.             animStringValueObject.Parent = nil
  1208.             toolAnimTime = time + .3
  1209.         end
  1210.  
  1211.         if time > toolAnimTime then
  1212.             toolAnimTime = 0
  1213.             toolAnim = "None"
  1214.         end
  1215.  
  1216.         animateTool()      
  1217.     else
  1218.         stopToolAnimations()
  1219.         toolAnim = "None"
  1220.         toolAnimInstance = nil
  1221.         toolAnimTime = 0
  1222.     end
  1223. end
  1224.  
  1225. -- connect events
  1226. Humanoid.Died:connect(onDied)
  1227. Humanoid.Running:connect(onRunning)
  1228. Humanoid.Jumping:connect(onJumping)
  1229. Humanoid.Climbing:connect(onClimbing)
  1230. Humanoid.GettingUp:connect(onGettingUp)
  1231. Humanoid.FreeFalling:connect(onFreeFall)
  1232. Humanoid.FallingDown:connect(onFallingDown)
  1233. Humanoid.Seated:connect(onSeated)
  1234. Humanoid.PlatformStanding:connect(onPlatformStanding)
  1235. Humanoid.Swimming:connect(onSwimming)
  1236.  
  1237. -- setup emote chat hook
  1238. game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
  1239.     local emote = ""
  1240.     if msg == "/e dance" then
  1241.         emote = dances[math.random(1, #dances)]
  1242.     elseif (string.sub(msg, 1, 3) == "/e ") then
  1243.         emote = string.sub(msg, 4)
  1244.     elseif (string.sub(msg, 1, 7) == "/emote ") then
  1245.         emote = string.sub(msg, 8)
  1246.     end
  1247.    
  1248.     if (pose == "Standing" and emoteNames[emote] ~= nil) then
  1249.         playAnimation(emote, 0.1, Humanoid)
  1250.     end
  1251.  
  1252. end)
  1253.  
  1254.  
  1255. -- main program
  1256.  
  1257. -- initialize to idle
  1258. playAnimation("idle", 0.1, Humanoid)
  1259. pose = "Standing"
  1260.  
  1261. while Figure.Parent ~= nil do
  1262.     local _, time = wait(0.1)
  1263.     move(time)
  1264. end
  1265.  
  1266.  
  1267.  
  1268. end))
  1269. StringValue14.Name = "idle"
  1270. StringValue14.Parent = LocalScript13
  1271. Animation15.Name = "Animation1"
  1272. Animation15.Parent = StringValue14
  1273. Animation15.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  1274. NumberValue16.Name = "Weight"
  1275. NumberValue16.Parent = Animation15
  1276. NumberValue16.Value = 9
  1277. Animation17.Name = "Animation2"
  1278. Animation17.Parent = StringValue14
  1279. Animation17.AnimationId = "http://www.roblox.com/asset/?id=180435792"
  1280. NumberValue18.Name = "Weight"
  1281. NumberValue18.Parent = Animation17
  1282. NumberValue18.Value = 1
  1283. StringValue19.Name = "walk"
  1284. StringValue19.Parent = LocalScript13
  1285. Animation20.Name = "WalkAnim"
  1286. Animation20.Parent = StringValue19
  1287. Animation20.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1288. StringValue21.Name = "run"
  1289. StringValue21.Parent = LocalScript13
  1290. Animation22.Name = "RunAnim"
  1291. Animation22.Parent = StringValue21
  1292. Animation22.AnimationId = "http://www.roblox.com/asset/?id=180426354"
  1293. StringValue23.Name = "jump"
  1294. StringValue23.Parent = LocalScript13
  1295. Animation24.Name = "JumpAnim"
  1296. Animation24.Parent = StringValue23
  1297. Animation24.AnimationId = "http://www.roblox.com/asset/?id=125750702"
  1298. StringValue25.Name = "climb"
  1299. StringValue25.Parent = LocalScript13
  1300. Animation26.Name = "ClimbAnim"
  1301. Animation26.Parent = StringValue25
  1302. Animation26.AnimationId = "http://www.roblox.com/asset/?id=180436334"
  1303. StringValue27.Name = "toolnone"
  1304. StringValue27.Parent = LocalScript13
  1305. Animation28.Name = "ToolNoneAnim"
  1306. Animation28.Parent = StringValue27
  1307. Animation28.AnimationId = "http://www.roblox.com/asset/?id=182393478"
  1308. StringValue29.Name = "fall"
  1309. StringValue29.Parent = LocalScript13
  1310. Animation30.Name = "FallAnim"
  1311. Animation30.Parent = StringValue29
  1312. Animation30.AnimationId = "http://www.roblox.com/asset/?id=180436148"
  1313. StringValue31.Name = "sit"
  1314. StringValue31.Parent = LocalScript13
  1315. Animation32.Name = "SitAnim"
  1316. Animation32.Parent = StringValue31
  1317. Animation32.AnimationId = "http://www.roblox.com/asset/?id=178130996"
  1318. Part33.Name = "Head"
  1319. Part33.Parent = Model0
  1320. Part33.BrickColor = BrickColor.new("Cool yellow")
  1321. Part33.Locked = true
  1322. Part33.FormFactor = Enum.FormFactor.Symmetric
  1323. Part33.Size = Vector3.new(2, 1, 1)
  1324. Part33.CFrame = CFrame.new(-6, 4.49999905, -11, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1325. Part33.TopSurface = Enum.SurfaceType.Smooth
  1326. Part33.Color = Color3.new(0.992157, 0.917647, 0.552941)
  1327. Part33.Position = Vector3.new(-6, 4.49999905, -11)
  1328. Part33.Color = Color3.new(0.992157, 0.917647, 0.552941)
  1329. SpecialMesh34.Parent = Part33
  1330. SpecialMesh34.Scale = Vector3.new(1.25, 1.25, 1.25)
  1331. SpecialMesh34.Scale = Vector3.new(1.25, 1.25, 1.25)
  1332. Decal35.Name = "face"
  1333. Decal35.Parent = Part33
  1334. Decal35.Texture = "rbxasset://textures/face.png"
  1335. Attachment36.Name = "HairAttachment"
  1336. Attachment36.Parent = Part33
  1337. Attachment36.CFrame = CFrame.new(0, 0.600000024, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1338. Attachment36.Position = Vector3.new(0, 0.600000024, 0)
  1339. Attachment37.Name = "HatAttachment"
  1340. Attachment37.Parent = Part33
  1341. Attachment37.CFrame = CFrame.new(0, 0.600000024, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1342. Attachment37.Position = Vector3.new(0, 0.600000024, 0)
  1343. Attachment38.Name = "FaceFrontAttachment"
  1344. Attachment38.Parent = Part33
  1345. Attachment38.CFrame = CFrame.new(0, 0, -0.600000024, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1346. Attachment38.Position = Vector3.new(0, 0, -0.600000024)
  1347. Attachment39.Name = "FaceCenterAttachment"
  1348. Attachment39.Parent = Part33
  1349. Sound40.Name = "GettingUp"
  1350. Sound40.Parent = Part33
  1351. Sound40.SoundId = "rbxasset://sounds/action_get_up.mp3"
  1352. Sound40.Volume = 0.64999997615814
  1353. RemoteEvent41.Name = "CharacterSoundEvent"
  1354. RemoteEvent41.Parent = Sound40
  1355. Sound42.Name = "Died"
  1356. Sound42.Parent = Part33
  1357. Sound42.SoundId = "rbxasset://sounds/uuhhh.mp3"
  1358. Sound42.Volume = 0.64999997615814
  1359. RemoteEvent43.Name = "CharacterSoundEvent"
  1360. RemoteEvent43.Parent = Sound42
  1361. Sound44.Name = "FreeFalling"
  1362. Sound44.Parent = Part33
  1363. Sound44.SoundId = "rbxasset://sounds/action_falling.mp3"
  1364. Sound44.TimePosition = 0.016619052999999
  1365. Sound44.Volume = 0.36001586914062
  1366. Sound44.Looped = true
  1367. RemoteEvent45.Name = "CharacterSoundEvent"
  1368. RemoteEvent45.Parent = Sound44
  1369. Sound46.Name = "Jumping"
  1370. Sound46.Parent = Part33
  1371. Sound46.SoundId = "rbxasset://sounds/action_jump.mp3"
  1372. Sound46.Volume = 0.64999997615814
  1373. RemoteEvent47.Name = "CharacterSoundEvent"
  1374. RemoteEvent47.Parent = Sound46
  1375. Sound48.Name = "Landing"
  1376. Sound48.Parent = Part33
  1377. Sound48.SoundId = "rbxasset://sounds/action_jump_land.mp3"
  1378. Sound48.Volume = 1
  1379. RemoteEvent49.Name = "CharacterSoundEvent"
  1380. RemoteEvent49.Parent = Sound48
  1381. Sound50.Name = "Splash"
  1382. Sound50.Parent = Part33
  1383. Sound50.SoundId = "rbxasset://sounds/impact_water.mp3"
  1384. Sound50.Volume = 0.64999997615814
  1385. RemoteEvent51.Name = "CharacterSoundEvent"
  1386. RemoteEvent51.Parent = Sound50
  1387. Sound52.Name = "Running"
  1388. Sound52.Parent = Part33
  1389. Sound52.Pitch = 1.8500000238419
  1390. Sound52.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  1391. Sound52.Volume = 0.64999997615814
  1392. Sound52.Looped = true
  1393. RemoteEvent53.Name = "CharacterSoundEvent"
  1394. RemoteEvent53.Parent = Sound52
  1395. Sound54.Name = "Swimming"
  1396. Sound54.Parent = Part33
  1397. Sound54.Pitch = 1.6000000238419
  1398. Sound54.SoundId = "rbxasset://sounds/action_swim.mp3"
  1399. Sound54.Volume = 0.64999997615814
  1400. Sound54.Looped = true
  1401. RemoteEvent55.Name = "CharacterSoundEvent"
  1402. RemoteEvent55.Parent = Sound54
  1403. Sound56.Name = "Climbing"
  1404. Sound56.Parent = Part33
  1405. Sound56.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  1406. Sound56.Volume = 0.64999997615814
  1407. Sound56.Looped = true
  1408. RemoteEvent57.Name = "CharacterSoundEvent"
  1409. RemoteEvent57.Parent = Sound56
  1410. Part58.Name = "HumanoidRootPart"
  1411. Part58.Parent = Model0
  1412. Part58.Transparency = 1
  1413. Part58.CanCollide = false
  1414. Part58.Locked = true
  1415. Part58.FormFactor = Enum.FormFactor.Symmetric
  1416. Part58.Size = Vector3.new(2, 2, 1)
  1417. Part58.CFrame = CFrame.new(-6, 2.99999905, -11, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1418. Part58.BottomSurface = Enum.SurfaceType.Smooth
  1419. Part58.TopSurface = Enum.SurfaceType.Smooth
  1420. Part58.Position = Vector3.new(-6, 2.99999905, -11)
  1421. Attachment59.Name = "RootAttachment"
  1422. Attachment59.Parent = Part58
  1423. Motor6D60.Name = "RootJoint"
  1424. Motor6D60.Parent = Part58
  1425. Motor6D60.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  1426. Motor6D60.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  1427. Motor6D60.Part0 = Part58
  1428. Motor6D60.Part1 = Part71
  1429. Motor6D60.MaxVelocity = 0.10000000149012
  1430. Part61.Name = "Left Arm"
  1431. Part61.Parent = Model0
  1432. Part61.BrickColor = BrickColor.new("Cool yellow")
  1433. Part61.CanCollide = false
  1434. Part61.Locked = true
  1435. Part61.FormFactor = Enum.FormFactor.Symmetric
  1436. Part61.Size = Vector3.new(1, 2, 1)
  1437. Part61.CFrame = CFrame.new(-7.5, 2.99999905, -11, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1438. Part61.Color = Color3.new(0.992157, 0.917647, 0.552941)
  1439. Part61.Position = Vector3.new(-7.5, 2.99999905, -11)
  1440. Part61.Color = Color3.new(0.992157, 0.917647, 0.552941)
  1441. Attachment62.Name = "LeftShoulderAttachment"
  1442. Attachment62.Parent = Part61
  1443. Attachment62.CFrame = CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1444. Attachment62.Position = Vector3.new(0, 1, 0)
  1445. Attachment63.Name = "LeftGripAttachment"
  1446. Attachment63.Parent = Part61
  1447. Attachment63.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1448. Attachment63.Position = Vector3.new(0, -1, 0)
  1449. Part64.Name = "Left Leg"
  1450. Part64.Parent = Model0
  1451. Part64.BrickColor = BrickColor.new("Bright blue")
  1452. Part64.CanCollide = false
  1453. Part64.Locked = true
  1454. Part64.FormFactor = Enum.FormFactor.Symmetric
  1455. Part64.Size = Vector3.new(1, 2, 1)
  1456. Part64.CFrame = CFrame.new(-6.5, 0.999999046, -11, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1457. Part64.BottomSurface = Enum.SurfaceType.Smooth
  1458. Part64.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  1459. Part64.Position = Vector3.new(-6.5, 0.999999046, -11)
  1460. Part64.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  1461. Attachment65.Name = "LeftFootAttachment"
  1462. Attachment65.Parent = Part64
  1463. Attachment65.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1464. Attachment65.Position = Vector3.new(0, -1, 0)
  1465. Part66.Name = "Right Arm"
  1466. Part66.Parent = Model0
  1467. Part66.BrickColor = BrickColor.new("Cool yellow")
  1468. Part66.CanCollide = false
  1469. Part66.Locked = true
  1470. Part66.FormFactor = Enum.FormFactor.Symmetric
  1471. Part66.Size = Vector3.new(1, 2, 1)
  1472. Part66.CFrame = CFrame.new(-4.5, 2.99999905, -11, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1473. Part66.Color = Color3.new(0.992157, 0.917647, 0.552941)
  1474. Part66.Position = Vector3.new(-4.5, 2.99999905, -11)
  1475. Part66.Color = Color3.new(0.992157, 0.917647, 0.552941)
  1476. Attachment67.Name = "RightShoulderAttachment"
  1477. Attachment67.Parent = Part66
  1478. Attachment67.CFrame = CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1479. Attachment67.Position = Vector3.new(0, 1, 0)
  1480. Attachment68.Name = "RightGripAttachment"
  1481. Attachment68.Parent = Part66
  1482. Attachment68.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1483. Attachment68.Position = Vector3.new(0, -1, 0)
  1484. Part69.Name = "Right Leg"
  1485. Part69.Parent = Model0
  1486. Part69.BrickColor = BrickColor.new("Bright blue")
  1487. Part69.CanCollide = false
  1488. Part69.Locked = true
  1489. Part69.FormFactor = Enum.FormFactor.Symmetric
  1490. Part69.Size = Vector3.new(1, 2, 1)
  1491. Part69.CFrame = CFrame.new(-5.5, 0.999999046, -11, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1492. Part69.BottomSurface = Enum.SurfaceType.Smooth
  1493. Part69.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  1494. Part69.Position = Vector3.new(-5.5, 0.999999046, -11)
  1495. Part69.Color = Color3.new(0.0509804, 0.411765, 0.67451)
  1496. Attachment70.Name = "RightFootAttachment"
  1497. Attachment70.Parent = Part69
  1498. Attachment70.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1499. Attachment70.Position = Vector3.new(0, -1, 0)
  1500. Part71.Name = "Torso"
  1501. Part71.Parent = Model0
  1502. Part71.BrickColor = BrickColor.new("Dark green")
  1503. Part71.Locked = true
  1504. Part71.FormFactor = Enum.FormFactor.Symmetric
  1505. Part71.Size = Vector3.new(2, 2, 1)
  1506. Part71.CFrame = CFrame.new(-6, 2.99999905, -11, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1507. Part71.LeftSurface = Enum.SurfaceType.Weld
  1508. Part71.RightSurface = Enum.SurfaceType.Weld
  1509. Part71.Color = Color3.new(0.156863, 0.498039, 0.278431)
  1510. Part71.Position = Vector3.new(-6, 2.99999905, -11)
  1511. Part71.Color = Color3.new(0.156863, 0.498039, 0.278431)
  1512. Decal72.Name = "roblox"
  1513. Decal72.Parent = Part71
  1514. Attachment73.Name = "NeckAttachment"
  1515. Attachment73.Parent = Part71
  1516. Attachment73.CFrame = CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1517. Attachment73.Position = Vector3.new(0, 1, 0)
  1518. Attachment74.Name = "BodyFrontAttachment"
  1519. Attachment74.Parent = Part71
  1520. Attachment74.CFrame = CFrame.new(0, 0, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1521. Attachment74.Position = Vector3.new(0, 0, -0.5)
  1522. Attachment75.Name = "BodyBackAttachment"
  1523. Attachment75.Parent = Part71
  1524. Attachment75.CFrame = CFrame.new(0, 0, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1525. Attachment75.Position = Vector3.new(0, 0, 0.5)
  1526. Attachment76.Name = "LeftCollarAttachment"
  1527. Attachment76.Parent = Part71
  1528. Attachment76.CFrame = CFrame.new(-1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1529. Attachment76.Position = Vector3.new(-1, 1, 0)
  1530. Attachment77.Name = "RightCollarAttachment"
  1531. Attachment77.Parent = Part71
  1532. Attachment77.CFrame = CFrame.new(1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1533. Attachment77.Position = Vector3.new(1, 1, 0)
  1534. Attachment78.Name = "WaistFrontAttachment"
  1535. Attachment78.Parent = Part71
  1536. Attachment78.CFrame = CFrame.new(0, -1, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1537. Attachment78.Position = Vector3.new(0, -1, -0.5)
  1538. Attachment79.Name = "WaistCenterAttachment"
  1539. Attachment79.Parent = Part71
  1540. Attachment79.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1541. Attachment79.Position = Vector3.new(0, -1, 0)
  1542. Attachment80.Name = "WaistBackAttachment"
  1543. Attachment80.Parent = Part71
  1544. Attachment80.CFrame = CFrame.new(0, -1, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  1545. Attachment80.Position = Vector3.new(0, -1, 0.5)
  1546. Motor6D81.Name = "Right Shoulder"
  1547. Motor6D81.Parent = Part71
  1548. Motor6D81.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  1549. Motor6D81.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  1550. Motor6D81.Part0 = Part71
  1551. Motor6D81.Part1 = Part66
  1552. Motor6D81.MaxVelocity = 0.10000000149012
  1553. Motor6D82.Name = "Left Shoulder"
  1554. Motor6D82.Parent = Part71
  1555. Motor6D82.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  1556. Motor6D82.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  1557. Motor6D82.Part0 = Part71
  1558. Motor6D82.Part1 = Part61
  1559. Motor6D82.MaxVelocity = 0.10000000149012
  1560. Motor6D83.Name = "Right Hip"
  1561. Motor6D83.Parent = Part71
  1562. Motor6D83.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  1563. Motor6D83.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
  1564. Motor6D83.Part0 = Part71
  1565. Motor6D83.Part1 = Part69
  1566. Motor6D83.MaxVelocity = 0.10000000149012
  1567. Motor6D84.Name = "Left Hip"
  1568. Motor6D84.Parent = Part71
  1569. Motor6D84.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  1570. Motor6D84.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  1571. Motor6D84.Part0 = Part71
  1572. Motor6D84.Part1 = Part64
  1573. Motor6D84.MaxVelocity = 0.10000000149012
  1574. Motor6D85.Name = "Neck"
  1575. Motor6D85.Parent = Part71
  1576. Motor6D85.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  1577. Motor6D85.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  1578. Motor6D85.Part0 = Part71
  1579. Motor6D85.Part1 = Part33
  1580. Motor6D85.MaxVelocity = 0.10000000149012
  1581. for i,v in pairs(mas:GetChildren()) do
  1582.     v.Parent = workspace
  1583.     pcall(function() v:MakeJoints() end)
  1584. end
  1585. mas:Destroy()
  1586. for i,v in pairs(cors) do
  1587.     spawn(function()
  1588.         pcall(v)
  1589.     end)
  1590. end
  1591. end
  1592. end
  1593.  
  1594. game:GetService("UserInputService").InputBegan:connect(onKeyPress)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement