Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Could someone help me fix my sound playlist?

All of the song times are correct but it wont even play the first song.

wait()
game.Players.PlayerAdded:connect(function(nP)
wait()	
local Playlist=nP.PlayerGui		
for _,v in pairs(game.Lighting:GetChildren()) do
if v:IsA("Sound") then
v:Clone().Parent=Playlist
wait()
while wait() do	
Playlist.Song1:Play()
wait(118)
Playlist.Song1:Pause()			
Playlist.Song2:Play()
wait(94)
Playlist.Song2:Pause()
Playlist.Song3:Play()
wait(115)
Playlist.Song3:Pause()
end
end
end)

1 answer

I have something way easier

--------------------------------------------------
                  --==Varibles==--
--------------------------------------------------

local Audio = Instance.new("Sound")
local Player = script.Parent
local Template = 'http://www.roblox.com/asset/?id='

-------------------------------------------------
                 --==PLAYLIST==--
-------------------------------------------------

local Songs = {} -- Change the numbers here to the IDs of the songs. To add more songs, simply put a , after the last song and add your ID

--------------------------------------------------
                  --==Options==--
--------------------------------------------------

local Volume = 10 -- Set this to what you want the volume to be
local Pitch = 1 -- Set this to what you want the pitch to be (Recomended 1)
local Waitime = 121 -- Set this to how long you want each song to last, I recomend 121 because songs can be 2 min and you get that extra second in there for a pause
--------------------------------------------------
                  --==Player==--
--------------------------------------------------

Audio.Parent = script.Parent
Audio.Volume = Volume
Audio.Pitch = Pitch
Audio.MaxDistance = 20

while true do
wait(1)
for i, v in next, Songs do
	Audio.SoundId = Template..''..v
	Audio:Play()
	wait(Waitime)
end
end

This discussion is preserved as it was. New answers, comments, and votes are closed.