null nil false Sound 0.01 then classic_sRunning:Play() else classic_sRunning:Pause() end return end sClimbing:Stop() sSwimming:Stop() if (prevState == "FreeFall" and fallSpeed > 0.1) then local vol = math.min(1.0, math.max(0.0, (fallSpeed - 50) / 110)) sLanding.Volume = vol sLanding:Play() fallSpeed = 0 end if speed>0.5 then sRunning:Play() sRunning.Pitch = speed / 8.0 else sRunning:Stop() end prevState = "Run" end function onSwimming(speed) if (prevState ~= "Swim" and speed > 0.1) then local volume = math.min(1.0, speed / 350) sSplash.Volume = volume sSplash:Play() prevState = "Swim" end sClimbing:Stop() sRunning:Stop() sSwimming.Pitch = 1.6 sSwimming:Play() end function onClimbing(speed) sRunning:Stop() sSwimming:Stop() if speed>0.01 then sClimbing:Play() sClimbing.Pitch = speed / 5.5 else sClimbing:Stop() end prevState = "Climb" end -- connect up function stopLoopedSounds() sRunning:Stop() sClimbing:Stop() sSwimming:Stop() end function onState(state, sound) if state then sound:Play() end end if hasPlayer == nil then Humanoid.Died:connect(onDied) Humanoid.Running:connect(onRunning) Humanoid.Swimming:connect(onSwimming) Humanoid.Climbing:connect(onClimbing) Humanoid.Jumping:connect(function(state) if useClassicSounds then onState(state, classic_sJumping) else onStateNoStop(state, sJumping) prevState = "Jump" end end) Humanoid.GettingUp:connect(function(state) if useClassicSounds then onState(state, classic_sGettingUp) else stopLoopedSounds() onStateNoStop(state, sGettingUp) prevState = "GetUp" end end) Humanoid.FreeFalling:connect(function(state) if useClassicSounds then onState(state, classic_sFreeFalling) if classic_sJumping.IsPlaying then classic_sJumping:Stop() end else stopLoopedSounds() onStateFall(state, sFreeFalling) prevState = "FreeFall" end end) Humanoid.FallingDown:connect(function(state) if useClassicSounds then onState(state, classic_sFallingDown) else stopLoopedSounds() end end) Humanoid.StateChanged:connect(function(old, new) if not (new.Name == "Dead" or new.Name == "Running" or new.Name == "RunningNoPhysics" or new.Name == "Swimming" or new.Name == "Jumping" or new.Name == "GettingUp" or new.Name == "Freefall" or new.Name == "FallingDown") and not useClassicSounds then stopLoopedSounds() end end) GameSettings.Changed:connect(function(property) if property == "VirtualVersion" then useClassicSounds = GameSettings.VirtualVersion == Enum.VirtualVersion['2012'] or GameSettings.VirtualVersion == Enum.VirtualVersion['2013'] if useClassicSounds then stopLoopedSounds() end end end) end ]]> false LocalSound 0.01 then classic_sRunning:Play() else classic_sRunning:Pause() end return end sClimbing:Stop() sSwimming:Stop() if (prevState == "FreeFall" and fallSpeed > 0.1) then local vol = math.min(1.0, math.max(0.0, (fallSpeed - 50) / 110)) sLanding.Volume = vol sLanding:Play() fallSpeed = 0 end if speed>0.5 then sRunning:Play() sRunning.Pitch = speed / 8.0 else sRunning:Stop() end prevState = "Run" end function onSwimming(speed) if (prevState ~= "Swim" and speed > 0.1) then local volume = math.min(1.0, speed / 350) sSplash.Volume = volume sSplash:Play() prevState = "Swim" end sClimbing:Stop() sRunning:Stop() sSwimming.Pitch = 1.6 sSwimming:Play() end function onClimbing(speed) sRunning:Stop() sSwimming:Stop() if speed>0.01 then sClimbing:Play() sClimbing.Pitch = speed / 5.5 else sClimbing:Stop() end prevState = "Climb" end -- connect up function stopLoopedSounds() sRunning:Stop() sClimbing:Stop() sSwimming:Stop() end function onState(state, sound) if state then sound:Play() end end Humanoid.Died:connect(onDied) Humanoid.Running:connect(onRunning) Humanoid.Swimming:connect(onSwimming) Humanoid.Climbing:connect(onClimbing) Humanoid.Jumping:connect(function(state) if useClassicSounds then onState(state, classic_sJumping) else onStateNoStop(state, sJumping) prevState = "Jump" end end) Humanoid.GettingUp:connect(function(state) if useClassicSounds then onState(state, classic_sGettingUp) else stopLoopedSounds() onStateNoStop(state, sGettingUp) prevState = "GetUp" end end) Humanoid.FreeFalling:connect(function(state) if useClassicSounds then if classic_sJumping.IsPlaying then classic_sJumping:Stop() end onState(state, classic_sFreeFalling) else stopLoopedSounds() onStateFall(state, sFreeFalling) prevState = "FreeFall" end end) Humanoid.FallingDown:connect(function(state) if useClassicSounds then onState(state, classic_sFallingDown) else stopLoopedSounds() end end) Humanoid.StateChanged:connect(function(old, new) if not (new.Name == "Dead" or new.Name == "Running" or new.Name == "RunningNoPhysics" or new.Name == "Swimming" or new.Name == "Jumping" or new.Name == "GettingUp" or new.Name == "Freefall" or new.Name == "FallingDown") and not useClassicSounds then stopLoopedSounds() end end) GameSettings.Changed:connect(function(property) if property == "VirtualVersion" then useClassicSounds = GameSettings.VirtualVersion == Enum.VirtualVersion['2012'] or GameSettings.VirtualVersion == Enum.VirtualVersion['2013'] if useClassicSounds then stopLoopedSounds() end end end) ]]>