Just part of a script I am working on I have currently got local players = game.Players:GetPlayers()
To save the amount of players as a variable called players, how do I get it to wait until players is greater than or equal to 3. Thanks for the help in advance, Dstructiod
Just use the NumPlayers property in the Players service.
repeat wait() until game.Players.NumPlayers >= 3
Or if you want to go the way you're going, do this:
repeat wait() until #players >= 3
For your GUI problem, try this (make sure this is in a Script and not a LocalScript):
if #players == 5 then for i = 1,#players do local gui = game.ServerStorage.MF:Clone() --Clones the gui gui.Parent = players[i]:WaitForChild("PlayerGui") --In case PlayerGui doesn't exist yet. end end
You can do something very simple, like:
if #game.Players:GetPlayers() > 3 then --Gets Players and checks if 3 are there --text else end