Detect two players in a server

all I need is some way to wait until there are two players in a server.

repeat wait() until
     --detect two players

I just have never learned how to find number of players in a server, thanks in advance

1 Like
repeat Players.PlayerAdded:Wait() until #Players:GetPlayers() >= 2

but im sure there are probably better ways of doing this depending on the situation

1 Like

so could I just do

repeat wait() until
     #Players.NumPlayers >= 2

btw this is not a local script

That’s not how repeat until works, and I don’t see why you would need to modify the perfectly working example.

until --condition

sorry, I accidentally put an end there, but what does the pound sign mean in your #Players.NumPlayers >= 2

Length Operator