Advertisement
giantgamingchannel

giantgamingchannel Model script

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