Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make it so I can count every two players added?

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.

1 answer

you can use a while loop and the PlayerAdded event to do this

local Players = game:GetService("Players")

while true do
	for i = 1, 2 do
		Players.PlayerAdded:Wait() -- you can call :Wait() on an event to wait for it to fire
	end
	-- do something here
end

1 comment

0

Nevermind it only did it once and not again

This discussion is preserved as it was. New answers, comments, and votes are closed.