function stopLoopedSounds()sRunning:Stop()sClimbing:Stop()sSwimming:Stop()end Humanoid.Died:connect(onDied)Humanoid.Running:connect(onRunning)Humanoid.Swimming:connect(onSwimming)Humanoid.Climbing:connect(onClimbing)Humanoid.Jumping:connect(function(P)onStateNoStop(P,sJumping)prevState="\074\117\109\112"end)Humanoid.GettingUp:connect(function(P)stopLoopedSounds()onStateNoStop(P,sGettingUp)prevState="\071\101\116\085\112"end)Humanoid.FreeFalling:connect(function(P)stopLoopedSounds()onStateFall(P,sFreeFalling)prevState="\070\114\101\101\070\097\108\108"end)Humanoid.FallingDown:connect(function(P)stopLoopedSounds()onStateNoStop(P,sFallingDown)prevState="\070\097\108\108\105\110\103"end)Humanoid.StateChanged:connect(function(P,T)if not(T.Name=="\068\101\097\100"or T.Name=="\082\117\110\110\105\110\103"or T.Name=="\082\117\110\110\105\110\103\078\111\080\104\121\115\105\099\115"or T.Name=="\083\119\105\109\109\105\110\103"or T.Name=="\074\117\109\112\105\110\103"or T.Name=="\071\101\116\116\105\110\103\085\112"or T.Name=="\070\114\101\101\102\097\108\108"or T.Name=="\070\097\108\108\105\110\103\068\111\119\110")then stopLoopedSounds()end end)
-- connect up

function stopLoopedSounds()
	sRunning:Stop()
	sClimbing:Stop()
	sSwimming:Stop()
end

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()
	onStateNoStop(state, sFallingDown)
	prevState = "Falling"
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)
