I have tried just about everything to make this loop properly, but it won’t. None of the songs got deleted or anything, so I don’t know the problem. It plays the first correctly, but not the others. The loop seems to work so I think it’s something with the if statement. I’ve tried so many combinations for it, IsPlaying, IsPaused, Ended, Playing, TimeLength == 0, just about everything I could. Nothing worked. Thank you so much if you know the solution!
I’ve also tried no if statements and just waiting for the song to end,
songs = {
"http://www.roblox.com/asset/?id=285768873 ",
"http://www.roblox.com/asset/?id=6578243952 ",
"http://www.roblox.com/asset/?id=172530048 ",
}
function tablelength(s)
local count = 0
for _ in pairs(s) do count += 1 end
return count
end
length = tablelength(songs)
currentSong = 0
music = script.Sound
loop = true
while true do
if music.IsPaused == true then
currentSong += 1
if currentSong > length then
currentSong = 1
end
print("Now Playing - " .. tostring(songs[currentSong]))
music.SoundId = tostring(songs[currentSong])
music:Play()
end
wait(0.25)
end