I need help making this music script play the music randomly. I don't mean at random times. I mean the order at which they play.
local MarketPlaceService = game:GetService("MarketplaceService")
local Songs = {
2985440580,
396040845,
5015230842,
160442087,
705243700,
609738703,
4665733376,
647252174,
971730478
}
local SongObject = script.Parent.Song
local SongLabel = script.Parent.SongLabel
local MuteButton = script.Parent.MuteButton
MuteButton.MouseButton1Click:Connect(function()
if SongObject.Volume == 0.5 then
SongObject.Volume = 0
else
SongObject.Volume = 0.5
end
end)
while true do
for i = 1, #Songs do
local Song = Songs[i]
local SongInfo = MarketPlaceService:GetProductInfo(Song)
SongObject.SoundId = "rbxassetid://"..Song
SongObject:Play()
SongLabel.Visible = true
SongLabel.Text = SongInfo.Name
wait(3)
for i = 0, 1, 0.1 do
wait(0.1)
script.Parent.SongLabel.Transparency = i
end
print("Finished")
repeat wait() until SongObject.IsPlaying == false
end
end

1 comment
I may have done this wrong but it isn't working I think I may have put it in the wrong place