Hi I need some help linking music together but I don't know how to this. I need to make each one play as soon as the other one finishes. I have already got it ready to shuffle the songs.
✓ ANSWER ACCEPTED
How to chain music together?
1 answer
✓ Accepted answer
You can use the .IsPlaying property of sound to let the script yield until the current song is finished. So if you've got a table of songs, you could do something like
songs = { ... }
for _, song in pairs(songs) do
song:play()
while song.IsPlaying do
wait()
end
end
to iterate through each song in the list and play them each through.
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
Thanks I will try this out and let you know if it works. :)
Is it possible to get the length of the song through MarketplaceService?
Not that I'm aware of. However, if you've got some time beforehand, you could find out using something like function getLength(sound) local startTime=time() sound.Volume=0 sound:play() while sound.IsPlaying do wait() end return time()-startTime end
I have been working on this over the last couple of days and it is skipping while sound.IsPlaying do wait() and it isn't waiting, even when it says wait(50) it doesn't wait for 50 seconds?
I have just managed to fix the IsPlaying thanks for the help!