-- connect up


function stopLoopedSounds()
sRunning:Stop() 
sClimbing:Stop()
sSwimming:Stop()
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) onStateNoStop(state, sJumping) prevState = "Jump" end)
Humanoid.GettingUp:connect(function(state) stopLoopedSounds() onStateNoStop(state, sGettingUp) prevState = "GetUp" end)
Humanoid.FreeFalling:connect(function(state) stopLoopedSounds() onStateFall(state, sFreeFalling) prevState = "FreeFall" end)
Humanoid.FallingDown:connect(function(state) stopLoopedSounds() 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") then
stopLoopedSounds()
end
end)
end
