Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make all audios stop on the players death?

Asked by 2 years ago

I'm trying to figure out the script for when the player is dead, ALL sounds in-game are paused/stopped. I'm a terrible scripter, so be gentle :)

1 answer

Log in to vote
0
Answered by 2 years ago

there is two functions to stop or to pause an audio lets say there is a varable named "Song" which equals your audio, you would do (song:Pause) which stops the audio but when you resume it, it will resume where it was paused or (song:Stop) which stops the audio but when you resume it, it will start from the beginning

the event below detects if a player has died and fires everything in the event function

game.Players.LocalPlayer.Character.Humanoid.Died:Connect(function()
    --everything in here will fire when someone dies
end)

but I have a question, when you want all audio to stop. Do you want the audio in the server to stop, or the audio in the client to stop?

Ad

Answer this question