Hi, I have a game in Pre-Alpha, and my teleportation script is a bit buggy the first use, so I was wondering if there was somehow I could make a gui pop-up for the FIRST player that joins the server. I tried to do:
game.Players.PlayerAdded:Connect(function(player) local Players = game:GetService("Players") if Players <= 1 then player.PlayerGui:WaitForChild("serverinitiation").TextLabel.Visible = true end end)
But That didn't work. No output either. Any help?
For the gui, you'll need a local script. As for the rest, you wasted your time using an event. If you remove the event, the script will start the second the first person joins and the server is created anyways.
As for the local script, it'll be in any character that joins the game, so here's a solution: Either make a Server-Client communication, or just do this in a Local Script.
wait() Squirrels = false for i,v in pairs(game.Players) do if i > 1 then Squirrels = true end end if Squirrels == false then -- Do your GUI thingy or something end
Hope this helps.