So I have a script that works for the most part. It's in starterplayerscripts and basically when you join the game it plays a song, waits until the song is over(by seconds cause I dont know how to tell when it ends) then it plays the next and so on.
But the problem is if the player dies, it stops. No songs play at any point anymore unless you rejoin the game.
Here is the script:
local player = script.Parent.Parent
local gui = player:WaitForChild("PlayerGui")
local music = gui:WaitForChild("Music")
while true do
wait()
music.SongO:Play()
wait(96)
music.SongT:Play()
wait(92)
music.SongTH:Play()
wait(88)
end
There are no errors or anything, music simply just doesnt play anymore if you were to die or reset and I was wondering whats causing that and how i'd go about fixing it?

2 comments
humanoid.Died:Connect(function() song:Play()
^you need to "end)" the function.