I made a song script. It plays the song and displays the song name on an gui. But whenever a server 1st starts it plays in a single order. For instance I would have maybe marshmello alone then aaron smith dancin. It would just play it in that order. I want it to be random. So instead of always doing alone then dancin. I want it to be random so sometimes it does alone then dancin while other times it does dancin then alone. This is just an example of what i'm trying to do. I am a noob to scripting so please try and make it simple if you can. Also don't mind the mute button part. I have a mute button I scripted.
local MarketPlaceService = game:GetService("MarketplaceService")
local Songs = {
2985440580,
396040845,
5015230842,
160442087,
705243700
}
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)
SongLabel.Visible = false
repeat wait() until SongObject.IsPlaying == false
end
end
