I made GUI button that has two skip buttons. When you press forward skip, it plays a song playlist. Inside clickbutton, I added audio which inside of it, I added a script:
math.randomseed(tick())
02
math.random() -- throw out first not-very-random value (known limitation of lua)
03
04
musicTable = --Making a table of music / your songs
05
{
06
"rbxassetid://142305080", -- 1 - Let's Groove
07
"rbxassetid://671389213", -- 2 - Can't Touch This
08
"rbxassetid://609246843", -- 3 - Take on Me
09
"rbxassetid://1100823134", -- 4 - At Dawn
10
"rbxassetid://681266896", -- 5 - Safety Dance
11
"rbxassetid://323743169", -- 6 - Working for the Weekend
12
"rbxassetid://442656036", -- 7 - Don't you (Forget About Me)
13
"rbxassetid://706699539", -- 8 - Beat it
14
"rbxassetid://838691861" -- 9 - Hey you, you better keep walking!
15
}
16
17
script.Parent.Parent.MouseButton1Click:Connect(function()
18
while true do
19
local index = math.random(1, #musicTable - 1)
20
musicTable[1], musicTable[index] = musicTable[index], musicTable[1]
21
for i = 2, #musicTable-1 do
22
index = math.random(i, #musicTable)
23
musicTable[i], musicTable[index] = musicTable[index], musicTable[i]
24
end
25
for i = 1, #musicTable do
26
wait(1)
27
script.Parent.SoundId = musicTable[i]
28
script.Parent:Play()
29
script.Parent.Ended:wait()
30
end
31
end
32
end)
For some reason, it doesn't work at all. Why?

1 comment
It doesn't work at all now, do you want me to send the model of the GUI so you can look at it?