The local script that is in replicated first plays when the players first joins the game, also show a gui loading screen. I've used math.random but I keep getting errors and I'm not quite getting how to use and where to put math.random. I want the music to be played randomly, and also to keep playing the music once the sound is finished, another one plays.
local GUI = script:WaitForChild("LoadingScreen")
local plr = game.Players.LocalPlayer
GUI.Parent = plr.PlayerGui
script.Parent:RemoveDefaultLoadingScreen()
repeat
wait(.5)
until game:IsLoaded()
local Sound = script.Sound11
local IDs = {
1234,1233,1384,29472,94729,2947 (expample)
}
for i = math.random(1, #IDs) do
local ID = IDs[i]
Sound.SoundId = "rbxassetid://" .. ID
Sound:Play()
end
wait(10)
GUI.Frame:TweenPosition(UDim2.new(0,0,-1.5,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad, 1)
wait(1)
--for i = 2, 0, -0.01 do
-- Sound.Volume = i
-- print("count")
-- wait(.25)
--end
--Sound:Stop()
GUI:Destroy()

2 comments
You can get rid of the prints. I just did it to see if it works properly. By the way this is a server-script. I think just put it in a local-script so it runs on the client only.
cheers. apprecaited the help