0

# How can I make this sound on join script work without lag?

So this is the script I currently use to make a sound play when a player joins the game:

game.Players.PlayerAdded:connect(function(player)
repeat wait() until player:findFirstChild("PlayerGui") -- Waits for PlayerGui to load
player.PlayerGui.Sound:Play(Intro)
end)



And it worked fine. However, after I built my game, the sound now takes 10-15 seconds to play. I think it is because of line 2 where it waits for the player gui. Is there a way I can make it play, for only the player who joins, as soon as they join, without the lag?