When other people join the game, the script plays music again and it overlaps the sounds, making it a pain to listen to.
while wait() do
local song=math.random(1,5);
if song==1 then
game.Workspace.Feeling:Play()
wait(120)
game.Workspace.Feeling:Stop()
elseif song==2 then
game.Workspace.Po:play()
wait(120)
game.Workspace.Po:Stop()
elseif song==3 then
game.Workspace.Demons:play()
wait(120)
game.Workspace.Demons:Stop()
elseif song==4 then
game.Workspace.Trumpets:play()
wait(45)
game.Workspace.Trumpets:Stop()
elseif song==5 then
game.Workspace.Survival:play()
wait(100)
game.Workspace.Survival:Stop()
end
end
I have also tried this:
function startSong()
local isStarted1 = false
local isStarted2 = false
while true do
if not isStarted1 then
game.Workspace.song1name:Play()
isStarted1 = true
wait(song1length)
game.Workspace.song1name:Stop()
isStarted1 = false
elseif not isStarted 2 then
game.Workspace.song1name:play()
isStarted2 = true
wait(song2length)
game.Workspace.song2name:Stop()
isStarted2 = false
end
wait(1) -- Wait 1 second before relooping again, or it will crash for StackOverflow (infinite loop)
end
end
startSong()

6 comments
Is this inside the StarterGui? If not, I don't see why it's keeps playing music when more people join.
Post the entire script.
Those are the ENTIRE Scripts.
And yes, it is in the StarterGUI.
That's the reason why. Try moving it to workspace. Or are you trying to play it just for the player?
Its for all players. But I'm trying to make it so that all the players universally here ONE tune together.