Please help me with this

I need to make a property (“Players”) that updates depending on how many players there are and sets that amount to be a target for the counter. So when (amount of players) is in a zone it hides a prop.

There’s a guide that shows you how to set the value of a counter to the number of players in a game: Detect the number of players in your game! You can set the counter to update a property - this property can be used in evaluations later on.

You’ll need to use blocks to compare the value of multiple properties, but you can use a block-compatible device (I used an item granter because of its low memory cost) to do those comparisons.


When players enter the zone, the value of the counter is incremented. When players exit the zone, the value is decremented. This value is then stored in the variable players_in.

Every time the value of ‘players_in’ is changed, a wire pulse block in the item granter is run:
image
If the number of players in the zone is equal to the number of total players, a message is sent that deactivates the barrier.

4 Likes

Thx so much. This is really important because its for my boss battle.

2 Likes

Umm… it won;t work

image

1 Like

Nvm I forgot to make total_players a property

What is this device?:

Screenshot 2024-06-20 205509

I mean, like what is it called? I"ve seen it in guides but have no idea what it is…

It’s a property!
Also, please don’t necropost!

2 Likes

When you’re in the settings of it on the top left there should be the device’s name.
And lol, this is a year old.

I’m not very good at coding or propreties o idk

1 Like

No this is from a year ago, please don’t necropost.

Thank you anyways!!!

2 Likes