How do I detect when all players are in a certain zone?

I need to detect when all the players in a game are in the zone so it will end the game. Any idea how to do this.

use a live player counter

You can use this to get a live player counter.

For the ending zone, check if the amount of players in the zone (Can be found with a counter linked to number property) to the amount of players in the game.

1 Like

huh? I don’t understand

In order to see if all players are somewhere, you need to track how many players there are in the first place. Thus, a player counter.

1 Like

well I will know how many players there are and I understand what the live counter does, but I need a thing that will auto stop the game when all the players are in the zone.

Ok, so maybe have a counter wired to the zone, and have the target be the number of players. Have it increment when a player enters, and decrement when they exit. When the target is reached, have it broadcast to an end game.

1 Like

but how do i make it so that it knows how many players there are without me having to change it whenever the amount of people changes, is that even possible? Like is there a way where I can tell it if the live counter =x than when the zone counter=x end game or smth?

If you want it to be accurate, you’d need the live player counter, and then have the zone counter update a property, lets call it ‘zone’.
Remove the target from the counter, and add a trigger that is wired to the zone, so it triggers when the zone is entered.
Have the live player counter in the guide update a property, let’s call that ‘p’ .
In the trigger’s block code, set it up like this:
image
I’d recommend giving the trigger a 0.2 delay so the value on the counter is accurate.

1 Like

how do i make it update a property, i dont see the option for block code in the counters settings.

In the property settings of the counter, right next to the ‘featured’.

1 Like

Ok thank you so much for this this helps a lot!

1 Like

Did it work?

i mean i think it will, lemme check

no i didnt work, ill tinker with it though

Ok, sorry I couldn’t help!

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.