How do I get these songs to loop?

Hello everyone,

I have this script which at the moment plays all 4 songs in order from 1 to 4 and then stops and doesn’t play anymore, but what I want it to do is when it gets to song number 4 to loop and go back to song number 1 and just keep playing through them all.

Any idea how I can do this?

Script:

Check if any of the Sounds are looped.

No none of them are, but when I did loop them it just played the first sound over again and didn’t play the rest.

You can make a script with an table and it will work perfect take my script here it’s also a free model that i made but yea i think you will understand it if you know what tables are.

You can also duplicate the Sound1 and add more but you will also need to duplicate it in the for , v loop

local Sound1 = script.Parent
local SongID = script.Parent.ID

local Songs = { -- Song id's here
	6032653117,
	5355577194
}

while true do
	for i ,v in pairs(Songs) do
		Sound1.SoundId = "rbxassetid://"..v
		Sound1.TimePosition = 0
		wait(0.5)
		SongID.Value = v
		wait(Sound1.TimeLength)
		Sound1:Play()
	end
end
1 Like

Not sure how well this’ll help, but maybe try to put all your sounds in a Folder in workspace called “Sounds” and use this to loop through all of them instead?

local sounds = workspace.Sounds:GetChildren()

while true do
	for _,sound in pairs(sounds) do
		sound:Play()
		sound.Ended:Wait()
		wait(5)
	end
end
1 Like

Thanks to all your help and I have finally found a solution! Thanks again! :grin: