Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --By giantgamingchannel.
- --Discord: Polandball (giant)#3166
- function onKeyPress(inputObject, gameProcessedEvent)
- if inputObject.KeyCode == Enum.KeyCode.K then
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Model0 = Instance.new("Model")
- BodyColors1 = Instance.new("BodyColors")
- Pants2 = Instance.new("Pants")
- Shirt3 = Instance.new("Shirt")
- Accessory4 = Instance.new("Accessory")
- Part5 = Instance.new("Part")
- SpecialMesh6 = Instance.new("SpecialMesh")
- Attachment7 = Instance.new("Attachment")
- Vector3Value8 = Instance.new("Vector3Value")
- Weld9 = Instance.new("Weld")
- Accessory10 = Instance.new("Accessory")
- Part11 = Instance.new("Part")
- SpecialMesh12 = Instance.new("SpecialMesh")
- Attachment13 = Instance.new("Attachment")
- Vector3Value14 = Instance.new("Vector3Value")
- Weld15 = Instance.new("Weld")
- Script16 = Instance.new("Script")
- Humanoid17 = Instance.new("Humanoid")
- Script18 = Instance.new("Script")
- LocalScript19 = Instance.new("LocalScript")
- LocalScript20 = Instance.new("LocalScript")
- StringValue21 = Instance.new("StringValue")
- Animation22 = Instance.new("Animation")
- NumberValue23 = Instance.new("NumberValue")
- Animation24 = Instance.new("Animation")
- NumberValue25 = Instance.new("NumberValue")
- StringValue26 = Instance.new("StringValue")
- Animation27 = Instance.new("Animation")
- StringValue28 = Instance.new("StringValue")
- Animation29 = Instance.new("Animation")
- StringValue30 = Instance.new("StringValue")
- Animation31 = Instance.new("Animation")
- StringValue32 = Instance.new("StringValue")
- Animation33 = Instance.new("Animation")
- StringValue34 = Instance.new("StringValue")
- Animation35 = Instance.new("Animation")
- StringValue36 = Instance.new("StringValue")
- Animation37 = Instance.new("Animation")
- StringValue38 = Instance.new("StringValue")
- Animation39 = Instance.new("Animation")
- Part40 = Instance.new("Part")
- SpecialMesh41 = Instance.new("SpecialMesh")
- Attachment42 = Instance.new("Attachment")
- Attachment43 = Instance.new("Attachment")
- Attachment44 = Instance.new("Attachment")
- Attachment45 = Instance.new("Attachment")
- Sound46 = Instance.new("Sound")
- RemoteEvent47 = Instance.new("RemoteEvent")
- Sound48 = Instance.new("Sound")
- RemoteEvent49 = Instance.new("RemoteEvent")
- Sound50 = Instance.new("Sound")
- RemoteEvent51 = Instance.new("RemoteEvent")
- Sound52 = Instance.new("Sound")
- RemoteEvent53 = Instance.new("RemoteEvent")
- Sound54 = Instance.new("Sound")
- RemoteEvent55 = Instance.new("RemoteEvent")
- Sound56 = Instance.new("Sound")
- RemoteEvent57 = Instance.new("RemoteEvent")
- Sound58 = Instance.new("Sound")
- RemoteEvent59 = Instance.new("RemoteEvent")
- Sound60 = Instance.new("Sound")
- RemoteEvent61 = Instance.new("RemoteEvent")
- Sound62 = Instance.new("Sound")
- RemoteEvent63 = Instance.new("RemoteEvent")
- Decal64 = Instance.new("Decal")
- Part65 = Instance.new("Part")
- Attachment66 = Instance.new("Attachment")
- Motor6D67 = Instance.new("Motor6D")
- Part68 = Instance.new("Part")
- Attachment69 = Instance.new("Attachment")
- Attachment70 = Instance.new("Attachment")
- Part71 = Instance.new("Part")
- Attachment72 = Instance.new("Attachment")
- Part73 = Instance.new("Part")
- Attachment74 = Instance.new("Attachment")
- Attachment75 = Instance.new("Attachment")
- Part76 = Instance.new("Part")
- Attachment77 = Instance.new("Attachment")
- Part78 = Instance.new("Part")
- Decal79 = Instance.new("Decal")
- Attachment80 = Instance.new("Attachment")
- Attachment81 = Instance.new("Attachment")
- Attachment82 = Instance.new("Attachment")
- Attachment83 = Instance.new("Attachment")
- Attachment84 = Instance.new("Attachment")
- Attachment85 = Instance.new("Attachment")
- Attachment86 = Instance.new("Attachment")
- Attachment87 = Instance.new("Attachment")
- Motor6D88 = Instance.new("Motor6D")
- Motor6D89 = Instance.new("Motor6D")
- Motor6D90 = Instance.new("Motor6D")
- Motor6D91 = Instance.new("Motor6D")
- Motor6D92 = Instance.new("Motor6D")
- Model0.Name = "giantgamingchannel"
- Model0.Parent = mas
- BodyColors1.Parent = Model0
- BodyColors1.HeadColor = BrickColor.new("Pastel brown")
- BodyColors1.LeftArmColor = BrickColor.new("Pastel brown")
- BodyColors1.LeftLegColor = BrickColor.new("Pastel brown")
- BodyColors1.RightArmColor = BrickColor.new("Light orange")
- BodyColors1.RightLegColor = BrickColor.new("Pastel brown")
- BodyColors1.TorsoColor = BrickColor.new("Pastel brown")
- Pants2.Name = "Pants"
- Pants2.Parent = Model0
- Pants2.PantsTemplate = "http://www.roblox.com/asset/?id=129458425"
- Shirt3.Name = "Shirt"
- Shirt3.Parent = Model0
- Shirt3.ShirtTemplate = "http://www.roblox.com/asset/?id=1424039584"
- Accessory4.Name = "2LEGITOwl"
- Accessory4.Parent = Model0
- Accessory4.AttachmentPos = Vector3.new(1.10000002, 0.379999995, 0)
- Part5.Name = "Handle"
- Part5.Parent = Accessory4
- Part5.CanCollide = false
- Part5.Locked = true
- Part5.FormFactor = Enum.FormFactor.Symmetric
- Part5.Size = Vector3.new(1, 1, 1)
- 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)
- Part5.BottomSurface = Enum.SurfaceType.Smooth
- Part5.TopSurface = Enum.SurfaceType.Smooth
- Part5.Position = Vector3.new(-1.1000185, 4.61999989, 0.000290859898)
- SpecialMesh6.Parent = Part5
- SpecialMesh6.MeshId = "http://www.roblox.com/asset/?id=329798434 "
- SpecialMesh6.Scale = Vector3.new(0.300000012, 0.300000012, 0.300000012)
- SpecialMesh6.TextureId = "http://www.roblox.com/asset/?id=329790966"
- SpecialMesh6.MeshType = Enum.MeshType.FileMesh
- SpecialMesh6.Scale = Vector3.new(0.300000012, 0.300000012, 0.300000012)
- Attachment7.Name = "LeftCollarAttachment"
- Attachment7.Parent = Part5
- Attachment7.Rotation = Vector3.new(0, 0, 3.91582424e-29)
- Attachment7.CFrame = CFrame.new(0.100000143, -0.619999886, -0.000272436155, 1, -6.83440315e-31, 0, 6.83440315e-31, 1, -0, 0, 0, 1)
- Attachment7.Position = Vector3.new(0.100000143, -0.619999886, -0.000272436155)
- Attachment7.Axis = Vector3.new(1, 6.83440315e-31, 0)
- Attachment7.Orientation = Vector3.new(0, 0, 3.91582424e-29)
- Vector3Value8.Name = "OriginalSize"
- Vector3Value8.Parent = Part5
- Vector3Value8.Value = Vector3.new(1, 1, 1)
- Weld9.Name = "AccessoryWeld"
- Weld9.Parent = Part5
- Weld9.C0 = CFrame.new(0.100000143, -0.619999886, -0.000272436155, 1, -6.83440315e-31, 0, 6.83440315e-31, 1, -0, 0, 0, 1)
- Weld9.C1 = CFrame.new(-1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld9.Part0 = Part5
- Weld9.Part1 = Part78
- Accessory10.Name = "BlueCharmerHair"
- Accessory10.Parent = Model0
- Accessory10.AttachmentPos = Vector3.new(0, 0.075000003, 0.0500000007)
- Part11.Name = "Handle"
- Part11.Parent = Accessory10
- Part11.CanCollide = false
- Part11.Locked = true
- Part11.FormFactor = Enum.FormFactor.Custom
- Part11.Size = Vector3.new(1.19999957, 1, 1.5999999)
- 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)
- Part11.BottomSurface = Enum.SurfaceType.Smooth
- Part11.TopSurface = Enum.SurfaceType.Smooth
- Part11.Position = Vector3.new(-1.79563085e-05, 4.92500019, -0.049699951)
- SpecialMesh12.Parent = Part11
- SpecialMesh12.MeshId = "http://www.roblox.com/asset/?id=74878559"
- SpecialMesh12.Scale = Vector3.new(1.04999995, 1, 1.04999995)
- SpecialMesh12.TextureId = "http://www.roblox.com/asset/?id=376776984 "
- SpecialMesh12.MeshType = Enum.MeshType.FileMesh
- SpecialMesh12.Scale = Vector3.new(1.04999995, 1, 1.04999995)
- Attachment13.Name = "HairAttachment"
- Attachment13.Parent = Part11
- Attachment13.Rotation = Vector3.new(2.37457877e-14, -1.86912021e-22, -4.50996566e-07)
- 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)
- Attachment13.Position = Vector3.new(8.65748007e-09, 0.174999714, 0.0497277565)
- Attachment13.Axis = Vector3.new(1, -7.87137555e-09, 0)
- Attachment13.Orientation = Vector3.new(2.37457877e-14, -1.86912021e-22, -4.50996566e-07)
- Vector3Value14.Name = "OriginalSize"
- Vector3Value14.Parent = Part11
- Vector3Value14.Value = Vector3.new(1.19999957, 1, 1.5999999)
- Weld15.Name = "AccessoryWeld"
- Weld15.Parent = Part11
- 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)
- Weld15.C1 = CFrame.new(0, 0.600000024, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Weld15.Part0 = Part11
- Weld15.Part1 = Part40
- Script16.Name = "Health"
- Script16.Parent = Model0
- table.insert(cors,sandbox(Script16,function()
- -- Gradually regenerates the Humanoid's Health over time.
- local REGEN_RATE = 1/100 -- Regenerate this fraction of MaxHealth per second.
- local REGEN_STEP = 1 -- Wait this long between each regeneration step.
- --------------------------------------------------------------------------------
- local Character = script.Parent
- local Humanoid = Character:WaitForChild'Humanoid'
- --------------------------------------------------------------------------------
- while true do
- while Humanoid.Health < Humanoid.MaxHealth do
- local dt = wait(REGEN_STEP)
- local dh = dt*REGEN_RATE*Humanoid.MaxHealth
- Humanoid.Health = math.min(Humanoid.Health + dh, Humanoid.MaxHealth)
- end
- Humanoid.HealthChanged:Wait()
- end
- end))
- Humanoid17.Parent = Model0
- Humanoid17.RightLeg = Part76
- Humanoid17.LeftLeg = Part71
- Humanoid17.Torso = Part65
- Script18.Name = "Sound"
- Script18.Parent = Model0
- table.insert(cors,sandbox(Script18,function()
- --[[
- Author: @spotco
- This script creates sounds which are placed under the character head.
- These sounds are used by the "LocalSound" script.
- To modify this script, copy it to your "StarterPlayer/StarterCharacterScripts" folder keeping the same script name ("Sound").
- The default Sound script loaded for every character will then be replaced with your copy of the script.
- ]]--
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local Players = game:GetService("Players")
- local SOUND_EVENT_FOLDER_NAME = "DefaultSoundEvents"
- local DEFAULT_SERVER_SOUND_EVENT_NAME = "DefaultServerSoundEvent"
- local SoundEventFolder = ReplicatedStorage:FindFirstChild(SOUND_EVENT_FOLDER_NAME)
- local DefaultServerSoundEvent = nil
- local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
- if useSoundDispatcher then
- if not SoundEventFolder then
- SoundEventFolder = Instance.new("Folder")
- SoundEventFolder.Name = SOUND_EVENT_FOLDER_NAME
- SoundEventFolder.Archivable = false
- SoundEventFolder.Parent = ReplicatedStorage
- end
- DefaultServerSoundEvent = SoundEventFolder:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
- else
- DefaultServerSoundEvent = ReplicatedStorage:FindFirstChild(DEFAULT_SERVER_SOUND_EVENT_NAME)
- end
- if not DefaultServerSoundEvent then
- if useSoundDispatcher then
- DefaultServerSoundEvent = Instance.new("RemoteEvent", SoundEventFolder)
- else
- DefaultServerSoundEvent = Instance.new("RemoteEvent", ReplicatedStorage)
- end
- DefaultServerSoundEvent.Name = DEFAULT_SERVER_SOUND_EVENT_NAME
- DefaultServerSoundEvent.OnServerEvent:Connect(function() end)
- end
- local function CreateNewSound(name, id, looped, pitch, parent)
- local sound = Instance.new("Sound")
- sound.SoundId = id
- sound.Name = name
- sound.archivable = false
- sound.Pitch = pitch
- sound.Looped = looped
- sound.MinDistance = 5
- sound.MaxDistance = 150
- sound.Volume = 0.65
- sound.Parent = parent
- if DefaultServerSoundEvent then
- local CharacterSoundEvent = Instance.new("RemoteEvent", sound)
- CharacterSoundEvent.Name = "CharacterSoundEvent"
- CharacterSoundEvent.OnServerEvent:Connect(function(player, playing, resetPosition)
- if type(playing) ~= "boolean" then
- return
- end
- if type(resetPosition) ~= "boolean" then
- return
- end
- if player.Character ~= script.Parent then
- return
- end
- for _, p in pairs(Players:GetPlayers()) do
- if p ~= player then
- -- Connect to the dispatcher to check if the player has loaded.
- if useSoundDispatcher then
- SoundEventFolder:FindFirstChild("SoundDispatcher"):Fire(p, sound, playing, resetPosition)
- else
- DefaultServerSoundEvent:FireClient(p, sound, playing, resetPosition)
- end
- end
- end
- end)
- end
- return sound
- end
- local head = script.Parent:FindFirstChild("Head")
- if not head then
- error("Sound script parent has no child Head.")
- return
- end
- CreateNewSound("GettingUp", "rbxasset://sounds/action_get_up.mp3", false, 1, head)
- CreateNewSound("Died", "rbxasset://sounds/uuhhh.mp3", false, 1, head)
- CreateNewSound("FreeFalling", "rbxasset://sounds/action_falling.mp3", true, 1, head)
- CreateNewSound("Jumping", "rbxasset://sounds/action_jump.mp3", false, 1, head)
- CreateNewSound("Landing", "rbxasset://sounds/action_jump_land.mp3", false, 1, head)
- CreateNewSound("Splash", "rbxasset://sounds/impact_water.mp3", false, 1, head)
- CreateNewSound("Running", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1.85, head)
- CreateNewSound("Swimming", "rbxasset://sounds/action_swim.mp3", true, 1.6, head)
- CreateNewSound("Climbing", "rbxasset://sounds/action_footsteps_plastic.mp3", true, 1, head)
- end))
- LocalScript19.Name = "LocalSound"
- LocalScript19.Parent = Script18
- table.insert(cors,sandbox(LocalScript19,function()
- --[[
- Author: @spotco
- This script runs locally for the player of the given humanoid.
- This script triggers humanoid sound play/pause actions locally.
- The Playing/TimePosition properties of Sound objects bypass FilteringEnabled, so this triggers the sound
- immediately for the player and is replicated to all other players.
- This script is optimized to reduce network traffic through minimizing the amount of property replication.
- ]]--
- --All sounds are referenced by this ID
- local SFX = {
- Died = 0;
- Running = 1;
- Swimming = 2;
- Climbing = 3,
- Jumping = 4;
- GettingUp = 5;
- FreeFalling = 6;
- FallingDown = 7;
- Landing = 8;
- Splash = 9;
- }
- local useUpdatedLocalSoundFlag = UserSettings():IsUserFeatureEnabled("UserFixCharacterSoundIssues")
- local Humanoid = nil
- local Head = nil
- --SFX ID to Sound object
- local Sounds = {}
- local SoundService = game:GetService("SoundService")
- local soundEventFolderName = "DefaultSoundEvents"
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local AddCharacterLoadedEvent = nil
- local RemoveCharacterEvent = nil
- local soundEventFolder = ReplicatedStorage:FindFirstChild(soundEventFolderName)
- local useSoundDispatcher = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher")
- if useSoundDispatcher then
- if not soundEventFolder then
- soundEventFolder = Instance.new("Folder", ReplicatedStorage)
- soundEventFolder.Name = soundEventFolderName
- soundEventFolder.Archivable = false
- end
- -- Load the RemoveCharacterEvent
- RemoveCharacterEvent = soundEventFolder:FindFirstChild("RemoveCharacterEvent")
- if RemoveCharacterEvent == nil then
- RemoveCharacterEvent = Instance.new("RemoteEvent", soundEventFolder)
- RemoveCharacterEvent.Name = "RemoveCharacterEvent"
- end
- AddCharacterLoadedEvent = soundEventFolder:FindFirstChild("AddCharacterLoadedEvent")
- if AddCharacterLoadedEvent == nil then
- AddCharacterLoadedEvent = Instance.new("RemoteEvent", soundEventFolder)
- AddCharacterLoadedEvent.Name = "AddCharacterLoadedEvent"
- end
- -- Notify the server a new character has been loaded
- AddCharacterLoadedEvent:FireServer()
- -- Notify the sound dispatcher this character has left.
- game.Players.LocalPlayer.CharacterRemoving:connect(function(character)
- RemoveCharacterEvent:FireServer(game.Players.LocalPlayer)
- end)
- end
- do
- local Figure = script.Parent.Parent
- Head = Figure:WaitForChild("Head")
- while not Humanoid do
- for _,NewHumanoid in pairs(Figure:GetChildren()) do
- if NewHumanoid:IsA("Humanoid") then
- Humanoid = NewHumanoid
- break
- end
- end
- if Humanoid then break end
- Figure.ChildAdded:wait()
- end
- Sounds[SFX.Died] = Head:WaitForChild("Died")
- Sounds[SFX.Running] = Head:WaitForChild("Running")
- Sounds[SFX.Swimming] = Head:WaitForChild("Swimming")
- Sounds[SFX.Climbing] = Head:WaitForChild("Climbing")
- Sounds[SFX.Jumping] = Head:WaitForChild("Jumping")
- Sounds[SFX.GettingUp] = Head:WaitForChild("GettingUp")
- Sounds[SFX.FreeFalling] = Head:WaitForChild("FreeFalling")
- Sounds[SFX.Landing] = Head:WaitForChild("Landing")
- Sounds[SFX.Splash] = Head:WaitForChild("Splash")
- local DefaultServerSoundEvent = nil
- if useSoundDispatcher then
- DefaultServerSoundEvent = soundEventFolder:FindFirstChild("DefaultServerSoundEvent")
- else
- DefaultServerSoundEvent = game:GetService("ReplicatedStorage"):FindFirstChild("DefaultServerSoundEvent")
- end
- if DefaultServerSoundEvent then
- DefaultServerSoundEvent.OnClientEvent:connect(function(sound, playing, resetPosition)
- if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") then
- if resetPosition and sound.TimePosition ~= 0 then
- sound.TimePosition = 0
- end
- if sound.IsPlaying ~= playing then
- sound.Playing = playing
- end
- else
- if sound.TimePosition ~= 0 then
- sound.TimePosition = 0
- end
- if not sound.IsPlaying then
- sound.Playing = true
- end
- end
- end)
- end
- end
- local IsSoundFilteringEnabled = function()
- return game.Workspace.FilteringEnabled and SoundService.RespectFilteringEnabled
- end
- local Util
- Util = {
- --Define linear relationship between (pt1x,pt2x) and (pt2x,pt2y). Evaluate this at x.
- YForLineGivenXAndTwoPts = function(x,pt1x,pt1y,pt2x,pt2y)
- --(y - y1)/(x - x1) = m
- local m = (pt1y - pt2y) / (pt1x - pt2x)
- --float b = pt1.y - m * pt1.x;
- local b = (pt1y - m * pt1x)
- return m * x + b
- end;
- --Clamps the value of "val" between the "min" and "max"
- Clamp = function(val,min,max)
- return math.min(max,math.max(min,val))
- end;
- --Gets the horizontal (x,z) velocity magnitude of the given part
- HorizontalSpeed = function(Head)
- local hVel = Head.Velocity + Vector3.new(0,-Head.Velocity.Y,0)
- return hVel.magnitude
- end;
- --Gets the vertical (y) velocity magnitude of the given part
- VerticalSpeed = function(Head)
- return math.abs(Head.Velocity.Y)
- end;
- --Setting Playing/TimePosition values directly result in less network traffic than Play/Pause/Resume/Stop
- --If these properties are enabled, use them.
- Play = function(sound)
- if IsSoundFilteringEnabled() then
- sound.CharacterSoundEvent:FireServer(true, true)
- end
- if sound.TimePosition ~= 0 then
- sound.TimePosition = 0
- end
- if not sound.IsPlaying then
- sound.Playing = true
- end
- end;
- Pause = function(sound)
- if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
- sound.CharacterSoundEvent:FireServer(false, false)
- end
- if sound.IsPlaying then
- sound.Playing = false
- end
- end;
- Resume = function(sound)
- if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
- sound.CharacterSoundEvent:FireServer(true, false)
- end
- if not sound.IsPlaying then
- sound.Playing = true
- end
- end;
- Stop = function(sound)
- if UserSettings():IsUserFeatureEnabled("UserPlayCharacterLoopSoundWhenFE") and IsSoundFilteringEnabled() then
- sound.CharacterSoundEvent:FireServer(false, true)
- end
- if sound.IsPlaying then
- sound.Playing = false
- end
- if sound.TimePosition ~= 0 then
- sound.TimePosition = 0
- end
- end;
- }
- do
- -- List of all active Looped sounds
- local playingLoopedSounds = {}
- -- Last seen Enum.HumanoidStateType
- local activeState = nil
- local fallSpeed = 0
- -- Verify and set that "sound" is in "playingLoopedSounds".
- function setSoundInPlayingLoopedSounds(sound)
- for i=1, #playingLoopedSounds do
- if playingLoopedSounds[i] == sound then
- return
- end
- end
- table.insert(playingLoopedSounds,sound)
- end
- -- Stop all active looped sounds except parameter "except". If "except" is not passed, all looped sounds will be stopped.
- function stopPlayingLoopedSoundsExcept(except)
- for i=#playingLoopedSounds,1,-1 do
- if playingLoopedSounds[i] ~= except then
- Util.Pause(playingLoopedSounds[i])
- table.remove(playingLoopedSounds,i)
- end
- end
- end
- -- Table of Enum.HumanoidStateType to handling function
- local stateUpdateHandler = {
- [Enum.HumanoidStateType.Dead] = function()
- stopPlayingLoopedSoundsExcept()
- local sound = Sounds[SFX.Died]
- Util.Play(sound)
- end;
- [Enum.HumanoidStateType.RunningNoPhysics] = function(speed)
- stateUpdated(Enum.HumanoidStateType.Running, speed)
- end;
- [Enum.HumanoidStateType.Running] = function(speed)
- local sound = Sounds[SFX.Running]
- stopPlayingLoopedSoundsExcept(sound)
- if(useUpdatedLocalSoundFlag and activeState == Enum.HumanoidStateType.Freefall and fallSpeed > 0.1) then
- -- Play a landing sound if the character dropped from a large distance
- local vol = math.min(1.0, math.max(0.0, (fallSpeed - 50) / 110))
- local freeFallSound = Sounds[SFX.FreeFalling]
- freeFallSound.Volume = vol
- Util.Play(freeFallSound)
- fallSpeed = 0
- end
- if useUpdatedLocalSoundFlag then
- if speed ~= nil and speed > 0.5 then
- Util.Resume(sound)
- setSoundInPlayingLoopedSounds(sound)
- elseif speed ~= nil then
- stopPlayingLoopedSoundsExcept()
- end
- else
- if Util.HorizontalSpeed(Head) > 0.5 then
- Util.Resume(sound)
- setSoundInPlayingLoopedSounds(sound)
- else
- stopPlayingLoopedSoundsExcept()
- end
- end
- end;
- [Enum.HumanoidStateType.Swimming] = function(speed)
- local threshold
- if useUpdatedLocalSoundFlag then threshold = speed else threshold = Util.VerticalSpeed(Head) end
- if activeState ~= Enum.HumanoidStateType.Swimming and threshold > 0.1 then
- local splashSound = Sounds[SFX.Splash]
- splashSound.Volume = Util.Clamp(
- Util.YForLineGivenXAndTwoPts(
- Util.VerticalSpeed(Head),
- 100, 0.28,
- 350, 1),
- 0,1)
- Util.Play(splashSound)
- end
- do
- local sound = Sounds[SFX.Swimming]
- stopPlayingLoopedSoundsExcept(sound)
- Util.Resume(sound)
- setSoundInPlayingLoopedSounds(sound)
- end
- end;
- [Enum.HumanoidStateType.Climbing] = function(speed)
- local sound = Sounds[SFX.Climbing]
- if useUpdatedLocalSoundFlag then
- if speed ~= nil and math.abs(speed) > 0.1 then
- Util.Resume(sound)
- stopPlayingLoopedSoundsExcept(sound)
- else
- Util.Pause(sound)
- stopPlayingLoopedSoundsExcept(sound)
- end
- else
- if Util.VerticalSpeed(Head) > 0.1 then
- Util.Resume(sound)
- stopPlayingLoopedSoundsExcept(sound)
- else
- stopPlayingLoopedSoundsExcept()
- end
- end
- setSoundInPlayingLoopedSounds(sound)
- end;
- [Enum.HumanoidStateType.Jumping] = function()
- if activeState == Enum.HumanoidStateType.Jumping then
- return
- end
- stopPlayingLoopedSoundsExcept()
- local sound = Sounds[SFX.Jumping]
- Util.Play(sound)
- end;
- [Enum.HumanoidStateType.GettingUp] = function()
- stopPlayingLoopedSoundsExcept()
- local sound = Sounds[SFX.GettingUp]
- Util.Play(sound)
- end;
- [Enum.HumanoidStateType.Freefall] = function()
- if activeState == Enum.HumanoidStateType.Freefall then
- return
- end
- local sound = Sounds[SFX.FreeFalling]
- sound.Volume = 0
- stopPlayingLoopedSoundsExcept()
- fallSpeed = math.max(fallSpeed, math.abs(Head.Velocity.y))
- end;
- [Enum.HumanoidStateType.FallingDown] = function()
- stopPlayingLoopedSoundsExcept()
- end;
- [Enum.HumanoidStateType.Landed] = function()
- stopPlayingLoopedSoundsExcept()
- if Util.VerticalSpeed(Head) > 75 then
- local landingSound = Sounds[SFX.Landing]
- landingSound.Volume = Util.Clamp(
- Util.YForLineGivenXAndTwoPts(
- Util.VerticalSpeed(Head),
- 50, 0,
- 100, 1),
- 0,1)
- Util.Play(landingSound)
- end
- end;
- [Enum.HumanoidStateType.Seated] = function()
- stopPlayingLoopedSoundsExcept()
- end;
- }
- -- Handle state event fired or OnChange fired
- function stateUpdated(state, speed)
- if stateUpdateHandler[state] ~= nil then
- if useUpdatedLocalSoundFlag and (state == Enum.HumanoidStateType.Running
- or state == Enum.HumanoidStateType.Climbing
- or state == Enum.HumanoidStateType.Swimming
- or state == Enum.HumanoidStateType.RunningNoPhysics) then
- stateUpdateHandler[state](speed)
- else
- stateUpdateHandler[state]()
- end
- end
- activeState = state
- end
- Humanoid.Died:connect( function() stateUpdated(Enum.HumanoidStateType.Dead) end)
- Humanoid.Running:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Running, speed) end)
- Humanoid.Swimming:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Swimming, speed) end)
- Humanoid.Climbing:connect( function(speed) stateUpdated(Enum.HumanoidStateType.Climbing, speed) end)
- Humanoid.Jumping:connect( function() stateUpdated(Enum.HumanoidStateType.Jumping) end)
- Humanoid.GettingUp:connect( function() stateUpdated(Enum.HumanoidStateType.GettingUp) end)
- Humanoid.FreeFalling:connect( function() stateUpdated(Enum.HumanoidStateType.Freefall) end)
- Humanoid.FallingDown:connect( function() stateUpdated(Enum.HumanoidStateType.FallingDown) end)
- -- required for proper handling of Landed event
- Humanoid.StateChanged:connect(function(old, new)
- stateUpdated(new)
- end)
- function onUpdate(stepDeltaSeconds, tickSpeedSeconds)
- local stepScale = stepDeltaSeconds / tickSpeedSeconds
- do
- local sound = Sounds[SFX.FreeFalling]
- if activeState == Enum.HumanoidStateType.Freefall then
- if Head.Velocity.Y < 0 and Util.VerticalSpeed(Head) > 75 then
- Util.Resume(sound)
- --Volume takes 1.1 seconds to go from volume 0 to 1
- local ANIMATION_LENGTH_SECONDS = 1.1
- local normalizedIncrement = tickSpeedSeconds / ANIMATION_LENGTH_SECONDS
- sound.Volume = Util.Clamp(sound.Volume + normalizedIncrement * stepScale, 0, 1)
- else
- sound.Volume = 0
- end
- else
- Util.Pause(sound)
- end
- end
- do
- local sound = Sounds[SFX.Running]
- if activeState == Enum.HumanoidStateType.Running then
- if Util.HorizontalSpeed(Head) < 0.5 then
- Util.Pause(sound)
- end
- end
- end
- end
- local lastTick = tick()
- local TICK_SPEED_SECONDS = 0.25
- while true do
- onUpdate(tick() - lastTick,TICK_SPEED_SECONDS)
- lastTick = tick()
- wait(TICK_SPEED_SECONDS)
- end
- end
- end))
- LocalScript20.Name = "Animate"
- LocalScript20.Parent = Model0
- table.insert(cors,sandbox(LocalScript20,function()
- local Figure = script.Parent
- local Torso = Figure:WaitForChild("Torso")
- local RightShoulder = Torso:WaitForChild("Right Shoulder")
- local LeftShoulder = Torso:WaitForChild("Left Shoulder")
- local RightHip = Torso:WaitForChild("Right Hip")
- local LeftHip = Torso:WaitForChild("Left Hip")
- local Neck = Torso:WaitForChild("Neck")
- local Humanoid = Figure:WaitForChild("Humanoid")
- local pose = "Standing"
- local currentAnim = ""
- local currentAnimInstance = nil
- local currentAnimTrack = nil
- local currentAnimKeyframeHandler = nil
- local currentAnimSpeed = 1.0
- local animTable = {}
- local animNames = {
- idle = {
- { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },
- { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 }
- },
- walk = {
- { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 }
- },
- run = {
- { id = "run.xml", weight = 10 }
- },
- jump = {
- { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 }
- },
- fall = {
- { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 }
- },
- climb = {
- { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 }
- },
- sit = {
- { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 }
- },
- toolnone = {
- { id = "http://www.roblox.com/asset/?id=182393478", weight = 10 }
- },
- toolslash = {
- { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
- -- { id = "slash.xml", weight = 10 }
- },
- toollunge = {
- { id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
- },
- wave = {
- { id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
- },
- point = {
- { id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
- },
- dance1 = {
- { id = "http://www.roblox.com/asset/?id=182435998", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491037", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491065", weight = 10 }
- },
- dance2 = {
- { id = "http://www.roblox.com/asset/?id=182436842", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491248", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491277", weight = 10 }
- },
- dance3 = {
- { id = "http://www.roblox.com/asset/?id=182436935", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491368", weight = 10 },
- { id = "http://www.roblox.com/asset/?id=182491423", weight = 10 }
- },
- laugh = {
- { id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
- },
- cheer = {
- { id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
- },
- }
- local dances = {"dance1", "dance2", "dance3"}
- -- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
- local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
- function configureAnimationSet(name, fileList)
- if (animTable[name] ~= nil) then
- for _, connection in pairs(animTable[name].connections) do
- connection:disconnect()
- end
- end
- animTable[name] = {}
- animTable[name].count = 0
- animTable[name].totalWeight = 0
- animTable[name].connections = {}
- -- check for config values
- local config = script:FindFirstChild(name)
- if (config ~= nil) then
- -- print("Loading anims " .. name)
- table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
- table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
- local idx = 1
- for _, childPart in pairs(config:GetChildren()) do
- if (childPart:IsA("Animation")) then
- table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
- animTable[name][idx] = {}
- animTable[name][idx].anim = childPart
- local weightObject = childPart:FindFirstChild("Weight")
- if (weightObject == nil) then
- animTable[name][idx].weight = 1
- else
- animTable[name][idx].weight = weightObject.Value
- end
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
- -- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
- idx = idx + 1
- end
- end
- end
- -- fallback to defaults
- if (animTable[name].count <= 0) then
- for idx, anim in pairs(fileList) do
- animTable[name][idx] = {}
- animTable[name][idx].anim = Instance.new("Animation")
- animTable[name][idx].anim.Name = name
- animTable[name][idx].anim.AnimationId = anim.id
- animTable[name][idx].weight = anim.weight
- animTable[name].count = animTable[name].count + 1
- animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
- -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
- end
- end
- end
- -- Setup animation objects
- function scriptChildModified(child)
- local fileList = animNames[child.Name]
- if (fileList ~= nil) then
- configureAnimationSet(child.Name, fileList)
- end
- end
- script.ChildAdded:connect(scriptChildModified)
- script.ChildRemoved:connect(scriptChildModified)
- for name, fileList in pairs(animNames) do
- configureAnimationSet(name, fileList)
- end
- -- ANIMATION
- -- declarations
- local toolAnim = "None"
- local toolAnimTime = 0
- local jumpAnimTime = 0
- local jumpAnimDuration = 0.3
- local toolTransitionTime = 0.1
- local fallTransitionTime = 0.3
- local jumpMaxLimbVelocity = 0.75
- -- functions
- function stopAllAnimations()
- local oldAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
- oldAnim = "idle"
- end
- currentAnim = ""
- currentAnimInstance = nil
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop()
- currentAnimTrack:Destroy()
- currentAnimTrack = nil
- end
- return oldAnim
- end
- function setAnimationSpeed(speed)
- if speed ~= currentAnimSpeed then
- currentAnimSpeed = speed
- currentAnimTrack:AdjustSpeed(currentAnimSpeed)
- end
- end
- function keyFrameReachedFunc(frameName)
- if (frameName == "End") then
- local repeatAnim = currentAnim
- -- return to idle if finishing an emote
- if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
- repeatAnim = "idle"
- end
- local animSpeed = currentAnimSpeed
- playAnimation(repeatAnim, 0.0, Humanoid)
- setAnimationSpeed(animSpeed)
- end
- end
- -- Preload animations
- function playAnimation(animName, transitionTime, humanoid)
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- -- switch animation
- if (anim ~= currentAnimInstance) then
- if (currentAnimTrack ~= nil) then
- currentAnimTrack:Stop(transitionTime)
- currentAnimTrack:Destroy()
- end
- currentAnimSpeed = 1.0
- -- load it to the humanoid; get AnimationTrack
- currentAnimTrack = humanoid:LoadAnimation(anim)
- currentAnimTrack.Priority = Enum.AnimationPriority.Core
- -- play the animation
- currentAnimTrack:Play(transitionTime)
- currentAnim = animName
- currentAnimInstance = anim
- -- set up keyframe name triggers
- if (currentAnimKeyframeHandler ~= nil) then
- currentAnimKeyframeHandler:disconnect()
- end
- currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
- end
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- local toolAnimName = ""
- local toolAnimTrack = nil
- local toolAnimInstance = nil
- local currentToolAnimKeyframeHandler = nil
- function toolKeyFrameReachedFunc(frameName)
- if (frameName == "End") then
- -- print("Keyframe : ".. frameName)
- playToolAnimation(toolAnimName, 0.0, Humanoid)
- end
- end
- function playToolAnimation(animName, transitionTime, humanoid, priority)
- local roll = math.random(1, animTable[animName].totalWeight)
- local origRoll = roll
- local idx = 1
- while (roll > animTable[animName][idx].weight) do
- roll = roll - animTable[animName][idx].weight
- idx = idx + 1
- end
- -- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
- local anim = animTable[animName][idx].anim
- if (toolAnimInstance ~= anim) then
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- transitionTime = 0
- end
- -- load it to the humanoid; get AnimationTrack
- toolAnimTrack = humanoid:LoadAnimation(anim)
- if priority then
- toolAnimTrack.Priority = priority
- end
- -- play the animation
- toolAnimTrack:Play(transitionTime)
- toolAnimName = animName
- toolAnimInstance = anim
- currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
- end
- end
- function stopToolAnimations()
- local oldAnim = toolAnimName
- if (currentToolAnimKeyframeHandler ~= nil) then
- currentToolAnimKeyframeHandler:disconnect()
- end
- toolAnimName = ""
- toolAnimInstance = nil
- if (toolAnimTrack ~= nil) then
- toolAnimTrack:Stop()
- toolAnimTrack:Destroy()
- toolAnimTrack = nil
- end
- return oldAnim
- end
- -------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------
- function onRunning(speed)
- if speed > 0.01 then
- playAnimation("walk", 0.1, Humanoid)
- if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
- setAnimationSpeed(speed / 14.5)
- end
- pose = "Running"
- else
- if emoteNames[currentAnim] == nil then
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- end
- end
- end
- function onDied()
- pose = "Dead"
- end
- function onJumping()
- playAnimation("jump", 0.1, Humanoid)
- jumpAnimTime = jumpAnimDuration
- pose = "Jumping"
- end
- function onClimbing(speed)
- playAnimation("climb", 0.1, Humanoid)
- setAnimationSpeed(speed / 12.0)
- pose = "Climbing"
- end
- function onGettingUp()
- pose = "GettingUp"
- end
- function onFreeFall()
- if (jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- end
- pose = "FreeFall"
- end
- function onFallingDown()
- pose = "FallingDown"
- end
- function onSeated()
- pose = "Seated"
- end
- function onPlatformStanding()
- pose = "PlatformStanding"
- end
- function onSwimming(speed)
- if speed > 0 then
- pose = "Running"
- else
- pose = "Standing"
- end
- end
- function getTool()
- for _, kid in ipairs(Figure:GetChildren()) do
- if kid.className == "Tool" then return kid end
- end
- return nil
- end
- function getToolAnim(tool)
- for _, c in ipairs(tool:GetChildren()) do
- if c.Name == "toolanim" and c.className == "StringValue" then
- return c
- end
- end
- return nil
- end
- function animateTool()
- if (toolAnim == "None") then
- playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
- return
- end
- if (toolAnim == "Slash") then
- playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
- return
- end
- if (toolAnim == "Lunge") then
- playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
- return
- end
- end
- function moveSit()
- RightShoulder.MaxVelocity = 0.15
- LeftShoulder.MaxVelocity = 0.15
- RightShoulder:SetDesiredAngle(3.14 /2)
- LeftShoulder:SetDesiredAngle(-3.14 /2)
- RightHip:SetDesiredAngle(3.14 /2)
- LeftHip:SetDesiredAngle(-3.14 /2)
- end
- local lastTick = 0
- function move(time)
- local amplitude = 1
- local frequency = 1
- local deltaTime = time - lastTick
- lastTick = time
- local climbFudge = 0
- local setAngles = false
- if (jumpAnimTime > 0) then
- jumpAnimTime = jumpAnimTime - deltaTime
- end
- if (pose == "FreeFall" and jumpAnimTime <= 0) then
- playAnimation("fall", fallTransitionTime, Humanoid)
- elseif (pose == "Seated") then
- playAnimation("sit", 0.5, Humanoid)
- return
- elseif (pose == "Running") then
- playAnimation("walk", 0.1, Humanoid)
- elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
- -- print("Wha " .. pose)
- stopAllAnimations()
- amplitude = 0.1
- frequency = 1
- setAngles = true
- end
- if (setAngles) then
- local desiredAngle = amplitude * math.sin(time * frequency)
- RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
- LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
- RightHip:SetDesiredAngle(-desiredAngle)
- LeftHip:SetDesiredAngle(-desiredAngle)
- end
- -- Tool Animation handling
- local tool = getTool()
- if tool and tool:FindFirstChild("Handle") then
- local animStringValueObject = getToolAnim(tool)
- if animStringValueObject then
- toolAnim = animStringValueObject.Value
- -- message recieved, delete StringValue
- animStringValueObject.Parent = nil
- toolAnimTime = time + .3
- end
- if time > toolAnimTime then
- toolAnimTime = 0
- toolAnim = "None"
- end
- animateTool()
- else
- stopToolAnimations()
- toolAnim = "None"
- toolAnimInstance = nil
- toolAnimTime = 0
- end
- end
- -- connect events
- Humanoid.Died:connect(onDied)
- Humanoid.Running:connect(onRunning)
- Humanoid.Jumping:connect(onJumping)
- Humanoid.Climbing:connect(onClimbing)
- Humanoid.GettingUp:connect(onGettingUp)
- Humanoid.FreeFalling:connect(onFreeFall)
- Humanoid.FallingDown:connect(onFallingDown)
- Humanoid.Seated:connect(onSeated)
- Humanoid.PlatformStanding:connect(onPlatformStanding)
- Humanoid.Swimming:connect(onSwimming)
- -- setup emote chat hook
- game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
- local emote = ""
- if msg == "/e dance" then
- emote = dances[math.random(1, #dances)]
- elseif (string.sub(msg, 1, 3) == "/e ") then
- emote = string.sub(msg, 4)
- elseif (string.sub(msg, 1, 7) == "/emote ") then
- emote = string.sub(msg, 8)
- end
- if (pose == "Standing" and emoteNames[emote] ~= nil) then
- playAnimation(emote, 0.1, Humanoid)
- end
- end)
- -- main program
- -- initialize to idle
- playAnimation("idle", 0.1, Humanoid)
- pose = "Standing"
- while Figure.Parent ~= nil do
- local _, time = wait(0.1)
- move(time)
- end
- end))
- StringValue21.Name = "idle"
- StringValue21.Parent = LocalScript20
- Animation22.Name = "Animation1"
- Animation22.Parent = StringValue21
- Animation22.AnimationId = "http://www.roblox.com/asset/?id=180435571"
- NumberValue23.Name = "Weight"
- NumberValue23.Parent = Animation22
- NumberValue23.Value = 9
- Animation24.Name = "Animation2"
- Animation24.Parent = StringValue21
- Animation24.AnimationId = "http://www.roblox.com/asset/?id=180435792"
- NumberValue25.Name = "Weight"
- NumberValue25.Parent = Animation24
- NumberValue25.Value = 1
- StringValue26.Name = "walk"
- StringValue26.Parent = LocalScript20
- Animation27.Name = "WalkAnim"
- Animation27.Parent = StringValue26
- Animation27.AnimationId = "http://www.roblox.com/asset/?id=180426354"
- StringValue28.Name = "run"
- StringValue28.Parent = LocalScript20
- Animation29.Name = "RunAnim"
- Animation29.Parent = StringValue28
- Animation29.AnimationId = "http://www.roblox.com/asset/?id=180426354"
- StringValue30.Name = "jump"
- StringValue30.Parent = LocalScript20
- Animation31.Name = "JumpAnim"
- Animation31.Parent = StringValue30
- Animation31.AnimationId = "http://www.roblox.com/asset/?id=125750702"
- StringValue32.Name = "climb"
- StringValue32.Parent = LocalScript20
- Animation33.Name = "ClimbAnim"
- Animation33.Parent = StringValue32
- Animation33.AnimationId = "http://www.roblox.com/asset/?id=180436334"
- StringValue34.Name = "toolnone"
- StringValue34.Parent = LocalScript20
- Animation35.Name = "ToolNoneAnim"
- Animation35.Parent = StringValue34
- Animation35.AnimationId = "http://www.roblox.com/asset/?id=182393478"
- StringValue36.Name = "fall"
- StringValue36.Parent = LocalScript20
- Animation37.Name = "FallAnim"
- Animation37.Parent = StringValue36
- Animation37.AnimationId = "http://www.roblox.com/asset/?id=180436148"
- StringValue38.Name = "sit"
- StringValue38.Parent = LocalScript20
- Animation39.Name = "SitAnim"
- Animation39.Parent = StringValue38
- Animation39.AnimationId = "http://www.roblox.com/asset/?id=178130996"
- Part40.Name = "Head"
- Part40.Parent = Model0
- Part40.BrickColor = BrickColor.new("Cool yellow")
- Part40.Locked = true
- Part40.FormFactor = Enum.FormFactor.Symmetric
- Part40.Size = Vector3.new(2, 1, 1)
- 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)
- Part40.TopSurface = Enum.SurfaceType.Smooth
- Part40.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part40.Position = Vector3.new(-1.83731318e-05, 4.5, 2.78051011e-05)
- Part40.Color = Color3.new(0.992157, 0.917647, 0.552941)
- SpecialMesh41.Parent = Part40
- SpecialMesh41.Scale = Vector3.new(1.25, 1.25, 1.25)
- SpecialMesh41.Scale = Vector3.new(1.25, 1.25, 1.25)
- Attachment42.Name = "HairAttachment"
- Attachment42.Parent = Part40
- Attachment42.CFrame = CFrame.new(0, 0.600000024, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment42.Position = Vector3.new(0, 0.600000024, 0)
- Attachment43.Name = "HatAttachment"
- Attachment43.Parent = Part40
- Attachment43.CFrame = CFrame.new(0, 0.600000024, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment43.Position = Vector3.new(0, 0.600000024, 0)
- Attachment44.Name = "FaceFrontAttachment"
- Attachment44.Parent = Part40
- Attachment44.CFrame = CFrame.new(0, 0, -0.600000024, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment44.Position = Vector3.new(0, 0, -0.600000024)
- Attachment45.Name = "FaceCenterAttachment"
- Attachment45.Parent = Part40
- Sound46.Name = "GettingUp"
- Sound46.Parent = Part40
- Sound46.SoundId = "rbxasset://sounds/action_get_up.mp3"
- Sound46.Volume = 0.64999997615814
- RemoteEvent47.Name = "CharacterSoundEvent"
- RemoteEvent47.Parent = Sound46
- Sound48.Name = "Died"
- Sound48.Parent = Part40
- Sound48.SoundId = "rbxasset://sounds/uuhhh.mp3"
- Sound48.Volume = 0.64999997615814
- RemoteEvent49.Name = "CharacterSoundEvent"
- RemoteEvent49.Parent = Sound48
- Sound50.Name = "FreeFalling"
- Sound50.Parent = Part40
- Sound50.SoundId = "rbxasset://sounds/action_falling.mp3"
- Sound50.TimePosition = 0.213914402
- Sound50.Volume = 1
- Sound50.Looped = true
- RemoteEvent51.Name = "CharacterSoundEvent"
- RemoteEvent51.Parent = Sound50
- Sound52.Name = "Jumping"
- Sound52.Parent = Part40
- Sound52.SoundId = "rbxasset://sounds/action_jump.mp3"
- Sound52.Volume = 0.64999997615814
- RemoteEvent53.Name = "CharacterSoundEvent"
- RemoteEvent53.Parent = Sound52
- Sound54.Name = "Landing"
- Sound54.Parent = Part40
- Sound54.SoundId = "rbxasset://sounds/action_jump_land.mp3"
- Sound54.Volume = 1
- RemoteEvent55.Name = "CharacterSoundEvent"
- RemoteEvent55.Parent = Sound54
- Sound56.Name = "Splash"
- Sound56.Parent = Part40
- Sound56.SoundId = "rbxasset://sounds/impact_water.mp3"
- Sound56.Volume = 0.64999997615814
- RemoteEvent57.Name = "CharacterSoundEvent"
- RemoteEvent57.Parent = Sound56
- Sound58.Name = "Running"
- Sound58.Parent = Part40
- Sound58.Pitch = 1.8500000238419
- Sound58.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
- Sound58.Volume = 0.64999997615814
- Sound58.Looped = true
- RemoteEvent59.Name = "CharacterSoundEvent"
- RemoteEvent59.Parent = Sound58
- Sound60.Name = "Swimming"
- Sound60.Parent = Part40
- Sound60.Pitch = 1.6000000238419
- Sound60.SoundId = "rbxasset://sounds/action_swim.mp3"
- Sound60.Volume = 0.64999997615814
- Sound60.Looped = true
- RemoteEvent61.Name = "CharacterSoundEvent"
- RemoteEvent61.Parent = Sound60
- Sound62.Name = "Climbing"
- Sound62.Parent = Part40
- Sound62.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
- Sound62.Volume = 0.64999997615814
- Sound62.Looped = true
- RemoteEvent63.Name = "CharacterSoundEvent"
- RemoteEvent63.Parent = Sound62
- Decal64.Name = "face"
- Decal64.Parent = Part40
- Decal64.Texture = "http://www.roblox.com/asset/?id=26424652"
- Part65.Name = "HumanoidRootPart"
- Part65.Parent = Model0
- Part65.Transparency = 1
- Part65.CanCollide = false
- Part65.Locked = true
- Part65.FormFactor = Enum.FormFactor.Symmetric
- Part65.Size = Vector3.new(2, 2, 1)
- Part65.CFrame = CFrame.new(-1.83731318e-05, 3, 2.78051011e-05, 1, 0, -8.52850008e-06, 0, 1, 0, 8.52850008e-06, 0, 1)
- Part65.BottomSurface = Enum.SurfaceType.Smooth
- Part65.TopSurface = Enum.SurfaceType.Smooth
- Part65.Position = Vector3.new(-1.83731318e-05, 3, 2.78051011e-05)
- Attachment66.Name = "RootAttachment"
- Attachment66.Parent = Part65
- Motor6D67.Name = "RootJoint"
- Motor6D67.Parent = Part65
- Motor6D67.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D67.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D67.Part0 = Part65
- Motor6D67.Part1 = Part78
- Motor6D67.MaxVelocity = 0.10000000149012
- Part68.Name = "Left Arm"
- Part68.Parent = Model0
- Part68.BrickColor = BrickColor.new("Cool yellow")
- Part68.CanCollide = false
- Part68.Locked = true
- Part68.FormFactor = Enum.FormFactor.Symmetric
- Part68.Size = Vector3.new(1, 2, 1)
- Part68.CFrame = CFrame.new(-1.50001836, 3, 1.50123506e-05, 1, 0, -8.52850008e-06, 0, 1, 0, 8.52850008e-06, 0, 1)
- Part68.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part68.Position = Vector3.new(-1.50001836, 3, 1.50123506e-05)
- Part68.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Attachment69.Name = "LeftShoulderAttachment"
- Attachment69.Parent = Part68
- Attachment69.CFrame = CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment69.Position = Vector3.new(0, 1, 0)
- Attachment70.Name = "LeftGripAttachment"
- Attachment70.Parent = Part68
- Attachment70.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment70.Position = Vector3.new(0, -1, 0)
- Part71.Name = "Left Leg"
- Part71.Parent = Model0
- Part71.BrickColor = BrickColor.new("Bright blue")
- Part71.CanCollide = false
- Part71.Locked = true
- Part71.FormFactor = Enum.FormFactor.Symmetric
- Part71.Size = Vector3.new(1, 2, 1)
- Part71.CFrame = CFrame.new(-0.500018358, 1, 2.35408515e-05, 1, 0, -8.52850008e-06, 0, 1, 0, 8.52850008e-06, 0, 1)
- Part71.BottomSurface = Enum.SurfaceType.Smooth
- Part71.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part71.Position = Vector3.new(-0.500018358, 1, 2.35408515e-05)
- Part71.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Attachment72.Name = "LeftFootAttachment"
- Attachment72.Parent = Part71
- Attachment72.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment72.Position = Vector3.new(0, -1, 0)
- Part73.Name = "Right Arm"
- Part73.Parent = Model0
- Part73.BrickColor = BrickColor.new("Cool yellow")
- Part73.CanCollide = false
- Part73.Locked = true
- Part73.FormFactor = Enum.FormFactor.Symmetric
- Part73.Size = Vector3.new(1, 2, 1)
- Part73.CFrame = CFrame.new(1.49998164, 3, 4.05978499e-05, 1, 0, -8.52850008e-06, 0, 1, 0, 8.52850008e-06, 0, 1)
- Part73.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Part73.Position = Vector3.new(1.49998164, 3, 4.05978499e-05)
- Part73.Color = Color3.new(0.992157, 0.917647, 0.552941)
- Attachment74.Name = "RightShoulderAttachment"
- Attachment74.Parent = Part73
- Attachment74.CFrame = CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment74.Position = Vector3.new(0, 1, 0)
- Attachment75.Name = "RightGripAttachment"
- Attachment75.Parent = Part73
- Attachment75.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment75.Position = Vector3.new(0, -1, 0)
- Part76.Name = "Right Leg"
- Part76.Parent = Model0
- Part76.BrickColor = BrickColor.new("Bright blue")
- Part76.CanCollide = false
- Part76.Locked = true
- Part76.FormFactor = Enum.FormFactor.Symmetric
- Part76.Size = Vector3.new(1, 2, 1)
- Part76.CFrame = CFrame.new(0.499981642, 1, 3.20693507e-05, 1, 0, -8.52850008e-06, 0, 1, 0, 8.52850008e-06, 0, 1)
- Part76.BottomSurface = Enum.SurfaceType.Smooth
- Part76.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Part76.Position = Vector3.new(0.499981642, 1, 3.20693507e-05)
- Part76.Color = Color3.new(0.0509804, 0.411765, 0.67451)
- Attachment77.Name = "RightFootAttachment"
- Attachment77.Parent = Part76
- Attachment77.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment77.Position = Vector3.new(0, -1, 0)
- Part78.Name = "Torso"
- Part78.Parent = Model0
- Part78.BrickColor = BrickColor.new("Dark green")
- Part78.Locked = true
- Part78.FormFactor = Enum.FormFactor.Symmetric
- Part78.Size = Vector3.new(2, 2, 1)
- Part78.CFrame = CFrame.new(-1.83731318e-05, 3, 2.78051011e-05, 1, 0, -8.52850008e-06, 0, 1, 0, 8.52850008e-06, 0, 1)
- Part78.LeftSurface = Enum.SurfaceType.Weld
- Part78.RightSurface = Enum.SurfaceType.Weld
- Part78.Color = Color3.new(0.156863, 0.498039, 0.278431)
- Part78.Position = Vector3.new(-1.83731318e-05, 3, 2.78051011e-05)
- Part78.Color = Color3.new(0.156863, 0.498039, 0.278431)
- Decal79.Name = "roblox"
- Decal79.Parent = Part78
- Attachment80.Name = "NeckAttachment"
- Attachment80.Parent = Part78
- Attachment80.CFrame = CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment80.Position = Vector3.new(0, 1, 0)
- Attachment81.Name = "BodyFrontAttachment"
- Attachment81.Parent = Part78
- Attachment81.CFrame = CFrame.new(0, 0, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment81.Position = Vector3.new(0, 0, -0.5)
- Attachment82.Name = "BodyBackAttachment"
- Attachment82.Parent = Part78
- Attachment82.CFrame = CFrame.new(0, 0, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment82.Position = Vector3.new(0, 0, 0.5)
- Attachment83.Name = "LeftCollarAttachment"
- Attachment83.Parent = Part78
- Attachment83.CFrame = CFrame.new(-1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment83.Position = Vector3.new(-1, 1, 0)
- Attachment84.Name = "RightCollarAttachment"
- Attachment84.Parent = Part78
- Attachment84.CFrame = CFrame.new(1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment84.Position = Vector3.new(1, 1, 0)
- Attachment85.Name = "WaistFrontAttachment"
- Attachment85.Parent = Part78
- Attachment85.CFrame = CFrame.new(0, -1, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment85.Position = Vector3.new(0, -1, -0.5)
- Attachment86.Name = "WaistCenterAttachment"
- Attachment86.Parent = Part78
- Attachment86.CFrame = CFrame.new(0, -1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment86.Position = Vector3.new(0, -1, 0)
- Attachment87.Name = "WaistBackAttachment"
- Attachment87.Parent = Part78
- Attachment87.CFrame = CFrame.new(0, -1, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Attachment87.Position = Vector3.new(0, -1, 0.5)
- Motor6D88.Name = "Right Shoulder"
- Motor6D88.Parent = Part78
- Motor6D88.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D88.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D88.Part0 = Part78
- Motor6D88.Part1 = Part73
- Motor6D88.MaxVelocity = 0.10000000149012
- Motor6D89.Name = "Left Shoulder"
- Motor6D89.Parent = Part78
- Motor6D89.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D89.C1 = CFrame.new(0.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D89.Part0 = Part78
- Motor6D89.Part1 = Part68
- Motor6D89.MaxVelocity = 0.10000000149012
- Motor6D90.Name = "Right Hip"
- Motor6D90.Parent = Part78
- Motor6D90.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D90.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
- Motor6D90.Part0 = Part78
- Motor6D90.Part1 = Part76
- Motor6D90.MaxVelocity = 0.10000000149012
- Motor6D91.Name = "Left Hip"
- Motor6D91.Parent = Part78
- Motor6D91.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D91.C1 = CFrame.new(-0.5, 1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Motor6D91.Part0 = Part78
- Motor6D91.Part1 = Part71
- Motor6D91.MaxVelocity = 0.10000000149012
- Motor6D92.Name = "Neck"
- Motor6D92.Parent = Part78
- Motor6D92.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D92.C1 = CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
- Motor6D92.Part0 = Part78
- Motor6D92.Part1 = Part40
- Motor6D92.MaxVelocity = 0.10000000149012
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
- end
- end
- game:GetService("UserInputService").InputBegan:connect(onKeyPress)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement