I want to make it so when 2 players join a game, it will do something, then wait for another 2 players and also do something.
you can use a while loop and the PlayerAdded event to do this
1 | local Players = game:GetService( "Players" ) |
2 |
3 | while true do |
4 | for i = 1 , 2 do |
5 | Players.PlayerAdded:Wait() -- you can call :Wait() on an event to wait for it to fire |
6 | end |
7 | -- do something here |
8 | end |