As said in the title, my background music script which is supposed to play a random songs after one ends is only playing 2 songs before it stops.
Script:
local musicFolder = script.Parent.Music
local currentlyPlaying = script.CurrentlyPlaying
local firstSong = musicFolder:GetChildren()[math.random(1,#musicFolder:GetChildren())]
firstSong:Play()
currentlyPlaying.Value = firstSong.Name
musicFolder:WaitForChild(currentlyPlaying.Value).Ended:Connect(function()
local nextSong = musicFolder:GetChildren()[math.random(1,#musicFolder:GetChildren())]
nextSong:Play()
currentlyPlaying.Value = nextSong.Name
end)
