I do not know how to do that so I am asking you guys
✓ ANSWER ACCEPTED
How do I wait until another person join then game starts?
3 answers
✓ Accepted answer
This should work, next time before posting please search online. I found it instantly. Thank you :)
local players = game:GetService("Players")
while wait() do -- Maybe don't use wait(), but just an example (https://devforum.roblox.com/t/avoiding-wait-and-why/244015)
if #players:GetPlayers() > 2 then -- checks to see if there is more than 2 players, #players returns the number of players for us :)
print(“Enough players! Starting”)
else
print(“Not enough players =(”)
end
end
game.Players.PlayerAdded:Connect(function()
stuff
end)
this should work:
repeat wait() until #game.Players:GetPlayers() >= 2
1 comment
0
what it will do it will keep waiting until there's enough players
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
i recommend using repeat and until