I wrote a simple music playlist script for my game, yet when the third song is supposed to play, it doesn’t work. This happens with every song that I try, and there are no errors in the output. I’m quite new to scripting so apologies if I’ve just made a rookie mistake.
music1 = "http://www.roblox.com/asset/?id=615592989"
music2 = "http://www.roblox.com/asset/?id=2023642240"
music3 = "http://www.roblox.com/asset/?id=2687873691"
local music = Instance.new("Sound")
music.Archivable = true
music.Parent = game.SoundService
music.Volume = 0.25
music.Looped = false
music.Name = "Music"
while true do
music.SoundId = music1
music:play()
wait(57)
music.SoundId = music2
music:play()
wait(235)
music.SoundId = music3
music:play()
wait(180)
end
Try to do this, can give wayy lower work for you
create a folder inside the SoundService
put all your sounds inside folder and create a script with this inside :
local music1 = game.SoundService(show the path for your folder)
local music2 = game.SoundService(show the path for your folder)
local music3 = game.SoundService(show the path for your folder)
while true do
music1:play()
music1.Ended:Wait()
music2:play()
music2.Ended:Wait()
music3:Play()
music3.Ended:wait()
end
put the script on workspace as a Script if you want play the same sound for all server (players join and the sound can be on the middle)
or localscript if you want play the sound for each player. (going to start for every player when player joins)
Good luck! =D