I have script where you have a GUI button, inside of it, there is an "Audio", and inside the "Audio" there is a script. When you click it, you have a playlist set of music that was intended to be played in a shuffled order. Here's how the script inside the "Audio" looks like;
musicTable = --Making a table of music / your songs
{
"rbxassetid://142305080", -- 1 - Let's Groove
"rbxassetid://142386715", -- 2 - Can't Touch This
"rbxassetid://276873987" -- 3 - Noob Song
}
--Instead of you doing wait(), we can use the event "Ended"
while true do
math.randomseed(tick()) --Creates a new seed every time(basically makes more random)
local randomSong = musicTable[math.random(1, #musicTable)]
wait(5) -- Just creating a small pause before a random song plays
script.Parent.SoundId = randomSong --Choose song
script.Parent:Play() --Play song
script.Parent.Ended:wait() -- Waiting until the song has finished
end
The only problem, after it plays one song, it still keeps repeating! How do I make it so that when it plays one song, it transitions to another in a shuffled order without looping?

3 comments
It doesn't even work at all anymore! How can I fix this now!
Oh, sorry about that - I forgot to rename 'list' to 'musicTable' in the script. I've updated it and tested it and it is working now.
Yeah, I already figured it out too before you replied to me. Thanks anyways!