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

How to not make the music restart after a player dies?

Asked by
Soban06 410 Moderation Voter
4 years ago

I have a music in my game. If a player dies, the music restarts. Why does that happen and how to stop it? I have a local script inside the started gui which just plays the sound:

game.Workspace.Music:Play()

But so when the player dies, the music restarts. I don't want that to happen.

Please help

Thanks

0
Is this a script inside of the player's character? If it is move it into starterplayerscripts/startercharacterscripts/ not the players character TiredMelon 405 — 4y
0
Is this inside a screengui ? If yes, turn off reset on spawn property (in the gui (the white and blue icon)) Nguyenlegiahung 1091 — 4y
0
I have this script inside the starter gui. Not a screen Gui. Soban06 410 — 4y
0
Just put the script inside a ScreenGui and set the property "ResetOnSpawn" to false, it should still work and it won't reset when the player respawns. xInfinityBear 1777 — 4y

1 answer

Log in to vote
0
Answered by
Axenori 124
4 years ago

Open StarterPlayer, create a local script in StarterPlayerScripts, and add a Sound instance into the Local script

Picture of how it should look: https://gyazo.com/c0beb54a36f1a08dcc95b139de892f2c

Then,type the following into the LocalScript:

local Music = script.Sound

Music:Play()

0
Thanks! Soban06 410 — 3y
Ad

Answer this question