local songs = {"rbxassetid://1127744908","rbxassetid://3215018144"}
local Radio = script.Parent
local ClickButton = Radio.ClickButton
local ClickDetector = ClickButton.ClickDetector
local Sound = Radio.ClickButton.Sound
ClickDetector.MouseClick:Connect(function(Click)
for i,v in pairs(songs) do
local sorted = songs[math.random(#songs)]-- all i did was add [] and then the normal line
Radio.ClickButton.Sound.SoundId = sorted --
ClickButton.Sound:Play()
if Radio.ClickButton.Sound.TimePosition == Radio.ClickButton.Sound.TimeLength then
Radio.ClickButton.Sound.SoundId = sorted
wait(0.1)
Radio.ClickButton.Sound.TimePosition = 0
ClickButton.Sound:Play()
end
end
end)
COMMUNITY QUESTION
How do I make it reshuffle the songs when the song is over?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Put your code in a whole codeblock
Done!