ID:266498
 
how do i make it so only 2 people in the game can do something at a time so another person can't enter if they are already in the place. show code. please help.
Knuckles skater wrote:
how do i make it so only 2 people in the game can do something at a time so another person can't enter if they are already in the place. show code. please help.

area/hot_tub
var
people_in = 0
max_people = 2

Enter(mob/who)
if(people_in >= max_people)
who << "Wait your turn!"
else
..()
people_in ++

Exited()
people_in --