Hello, So i have a minigame styled game and I need to figure out how to create a script to know when everyone leaves an area, so it can basically end the game. I had an idea of a way to do this by creating a boolvalue inside of the player and then making it true when the player exits the area (the area is just an invisible cancollide false part engulfing the entire space) and then a masterscript that can find the number of players in the game and basically know at all times if there is anyone inside of the area, and once no one is in it the game ends.
So basically, I think I got the masterscript covered, besides the part where it counts the amount of players in the game. Also it would need to be actively updated every round to know if the amount of players changes. I need some starting help to even begin to understand how to count the players. I do have the boolvalue injector though.
game.Players.PlayerAdded:connect(function(plr)
local FinishedValue = Instance.new('BoolValue', plr)
FinishedValue.Name = 'FinishedValue'
end)
Thank you for reading, if this sounds like a request, please let me know in the replies so I can somehow word it differently.

1 comment
I do not need a full script, but maybe just some hints and good variables and things to use when creating this? Just to get me started