So here is my code:
local playlist = {
stargazing = {
["Name"] = "Kygo - Stargazing ft. Justin Jesso",
["ID"] = "rbxassetid://1067101081",
["Info"] = "This music can't be used on YouTube."
},
skyhigh = {
["Name"] = "JJD - Skyhigh",
["ID"] = "rbxassetid://271028838",
["Info"] = "This music can be used on YouTube."
},
allfallsdown = {
["Name"] = "Alan Walker - All Falls Down",
["ID"] = "rbxassetid://1163496902",
["Info"] = "This music can't be used on YouTube."
}
}
local music = game.Workspace:WaitForChild("Music")
local playing = {}
while wait(5) do
print(#playlist)
if music.IsPlaying == false then
local pickMusic = math.random(1, #playlist)
playing = playlist[pickMusic]
local notif = Instance.new("Hint", game.Workspace)
notif.Name = "MusicNotif"
notif.Text = "Now playing: "..playing.Name.." - "..playing.Info
music.SoundId = playing.ID
music:Play()
end
end
Here is the output:
0 15:12:44.287 - ServerScriptService.Scripts.Playlist:28: bad argument #2 to 'random' (interval > is empty) 15:12:44.287 - Stack Begin 15:12:44.288 - Script 'ServerScriptService.Scripts.Playlist', Line 28 15:12:44.288 - Stack End

2 comments
local pickMusic = math.random(1, playlist)
see if that works