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

How can i get music to stop restarting whenever a player dies?

Asked by 5 years ago

this is been driving me crazy, and i have a script that plays music in the background. The annoying part is it restarts whenever they player dies. Is there a fix for this?

script.Parent:WaitForChild("Sound5"):Play()

script.Parent.Sound1.Ended:Connect(function()
    script.Parent.Sound1:Stop()
    script.Parent.Sound2:Play()
end)
script.Parent.Sound2.Ended:Connect(function()
    script.Parent.Sound2:Stop()
    script.Parent.Sound3:Play()
end)
script.Parent.Sound3.Ended:Connect(function()
    script.Parent.Sound3:Stop()
    script.Parent.Sound4:Play()
end)
script.Parent.Sound4.Ended:Connect(function()
    script.Parent.Sound4:Stop()
    script.Parent.Sound5:Play()
end)
script.Parent.Sound5.Ended:Connect(function()
    script.Parent.Sound5:Stop()
    script.Parent.Sound1:Play()
end)
0
They can't just reset when they die, they are most likely placed in the Backpack, PlayerGui, or Character. User#19524 175 — 5y
0
assuming you want the music to be for that client only, you could put them in a gui and then set ResetOnSpawn to false Vulkarin 581 — 5y
0
I'm assuming this script is in a local-script. You could always try puttting it in a server script so it doesn't stop and it plays at the same time for all players I think. RibgyTheRacoon 67 — 5y
0
Workspace / SoundService should work fine. Syclya 224 — 5y
0
oh yeah putting it inside a gui worked thanks i feel kinda stupid now Creeper_Dude158 11 — 5y

Answer this question