Music player should work, but it doesn't

Hi, so I made a music player that, in theory, should work but for some reason doesn’t.
Well, it does work, just not as intended. My goal for this music player is for it to cycle each song, wait for it to end and move on to the next one.

Instead of doing so, it just plays the first one on loop forever. I have verified that these sounds all work and have permission in the experience (from Roblox’s dumb audio update), so I’m not sure why it happens

Code
local currentSound = game.ReplicatedStorage:WaitForChild("CurrentMusic")

local Sound1 = script:WaitForChild("Sound")
local Sound2 = script:WaitForChild("Sound2")
local Sound3 = script:WaitForChild("Sound3")
local Sound4 = script:WaitForChild("Sound4")
local Sound5 = script:WaitForChild("Sound5")

while true do
	currentSound.SoundId = Sound1.Value
	currentSound:Play()
	currentSound.Ended:Wait()
	wait(3)
	currentSound.SoundId = Sound2.Value
	currentSound:Play()
	currentSound.Ended:Wait()
	wait(3)
	currentSound.SoundId = Sound3.Value
	currentSound:Play()
	currentSound.Ended:Wait()
	wait(3)
	currentSound.SoundId = Sound4.Value
	currentSound:Play()
	currentSound.Ended:Wait()
	wait(3)
	currentSound.SoundId = Sound5.Value
	currentSound:Play()
	currentSound.Ended:Wait()
	wait(3)
end

I know the script is really crude but I really did not want to make anything else so I just stuck with the bare bones.
Is there a specific cause to why this isn’t working? If so please let me know

Thank you in advance

Ended doesn’t fire if the sound has its Looped property set to true

1 Like

i still can’t believe i overlooked this haha
thanks anyways

https://developer.roblox.com/en-us/api-reference/event/Sound/DidLoop

In case you needed a signal specifically for this.