How to add a random playlist of music?
So I've been wondering how exactly would I add a random playlist of music. I have a folder in workspace called Music, and then under that folder two folders, with one being called lobby music, and the other called map music. I'm more concerned about the lobby music, because once I figure out how to do this, I can easily do it with the map music.
Under the Lobby music folder, there are three sounds and they all have the sound IDs.
(This is part of the script, it is a round script).
01 | local replicatedstorage = game:GetService( 'ReplicatedStorage' ) |
02 | local status = replicatedstorage:WaitForChild( 'InfoValue' ) |
03 | local mapstorage = game.Workspace:WaitForChild( 'mapStorage' ) |
04 | local lobmusic = game.Workspace.Music.LobbyMusic |
07 | while game.Players.NumPlayers < 1 do |
08 | status.Value = 'Two Players are needed to start a round' |
09 | repeat wait( 2 ) until game.Players.NumPlayers > = 2 |
15 | status.Value = 'Intermission (' ..i.. ')' |
It works, I just wonder how I would make it to where the music randomizes each time.