There's this script I have which it's parent is a Sound object. It gives you many songs but however they go in order. I want to make this playlist in shuffled order. I asked for help before and one guy gave me script that ended up having the first song in the list play again for the second time instead of transitioning to the next one.
while true do
script.Parent.SoundId= "rbxassetid://142304703" --1 Fortunate Son
script.Parent:Play()
script.Parent.Ended:wait()
wait(1)
script.Parent.SoundId= "rbxassetid://142304778" --2 I Can See Clearly Now
script.Parent:Play()
script.Parent.Ended:wait()
wait(1)
script.Parent.SoundId= "rbxassetid://142304968" --3 Imagine
script.Parent:Play()
script.Parent.Ended:wait()
wait(1)
script.Parent.SoundId= "rbxassetid://142305080" --4 Lets Groove
script.Parent:Play()
script.Parent.Ended:wait()
wait(1)
script.Parent.SoundId= "rbxassetid://142305170" --5 Mercy Me
script.Parent:Play()
script.Parent.Ended:wait()
wait(1)
end
How do I make this playlist go in shuffled order and not have the same songs repeated again for while until it it gets randomly picked again?

3 comments
Basically, just make all your music ID's go into a table. Then, have a random selector to choose a random one of them to play. To avoid immediate song repetition, make the script remove the most recent outcome from the table until the next song plays, then re-insert it.
If you're planning to use math.random() to make the next song to play chosen randomly, it'll play the same songs in the same order. You can use math.randomseed() to stop this behaviour. Read more about that here: http://wiki.roblox.com/index.php?title=Random_numbers
So the script that he gave me, is it shuffled playlist or it goes in order?