Example 1 played, 2 plays and goes on chronologically..
local Songs = {1, 2, 3, 4, 5} -- just an example lol local Play = true local ID = 000000 function New() ID = nil ID = Songs[math.random(1,#Songs)] -- i don't want dis :I( end game:GetService("RunService").Heartbeat:connect(function() if Play == true then New() Play = false script.Parent.Parent.Background:Pause() script.Parent.Parent.Background.SoundId="rbxassetid://"..ID wait() script.Parent.Parent.Background:Play() wait(script.Parent.Parent.Background.TimeLength) script.Parent.Parent.Background:Pause() Play = true end end)
Have a current song variable in your code to keep track of your songs.
local currentSong = 1
Then have the variable jump up every time you switch songs.
currentSong = currentSong + 1
Complete code
local Songs = {1, 2, 3, 4, 5} -- just an example lol local Play = true local ID = 000000 local currentSong = 1 function New() ID = nil ID = Songs[currentSong] -- i don't want dis :I( currentSong = currentSong + 1 end game:GetService("RunService").Heartbeat:connect(function() if Play == true then New() Play = false script.Parent.Parent.Background:Pause() script.Parent.Parent.Background.SoundId="rbxassetid://"..ID wait() script.Parent.Parent.Background:Play() wait(script.Parent.Parent.Background.TimeLength) script.Parent.Parent.Background:Pause() Play = true end end)