✓ Accepted answer
As you have a song id array you should use a numerical loop and not a generic for loop which can access in any order.
There are some other changes that you can make to help your code. First use event if there is one do not rely on things like wait() and second you are using script.Parent a lot so it is better to make a variable as you use the same ound instance each time you play a song.
To wait until the sound has finished playing you can use the event Ended and use the function :Wait() which will wait intil the event is fired and pass back any argument with the given event.
Example
local songs = {
279207008,
1610954983,
1610958262,
1610989227,
1610995500,
1611013339,
1611019115,
1611026677,
1611030715,
1611033388
}
local soundObj = script.Parent
while true do
for i=1, #songs do
soundObj.SoundId = "rbxassetid://" .. tostring(songs[i])
soundObj:Play()
soundObj.Ended:Wait()
end
end
I hope this helps.
1 comment
Thanks.