Sorry I’m bad at spelling titles :,)
So I got a security screen, which is suppose to update everytime a player of a certain touches the “danger” zone, like, we have 3 soldier, 3 prisonners, and 2 civilians, it’ll put on the screen :
Soldier : 3
Prisonners : 3
Civilian : 3
How can I do a thing like this (don’t require full script, just a thing to get the players and add a value)
Uhhh, you could probably use Region3 and find that player in “Players” and identify if they are on a team with some if statements. table.add() them if they are. Not exactly sure if this is really what you are asking for here but yeah.
If I am misunderstanding your question please correct me, but do you mean display the amount of players in a team onto a screen?
You can use Region3 to check which are they are in, here is an article if you need help understanding it. To sum it up it basically creates a box shaped region from the bottom left point and the top right point which you can then use to see if any players are touching it.
Next you will want to add these players to a table or team in the team folder, depending on how you are doing it. If table you can use table.insert() and table.remove() to add or remove players from a team and you can set a player’s team if you are doing it via team folder. Then you can get the number of that team by using GetChildren() and by putting a # in front of the definition or statement and set it to your screen. Hope this helps!
To help you understand the first parameter would be the bottom left point Vector3.new(2, 3, 4) and the second parameter would be the top right point Vector3.new(8, 6, 5). What Region3 does is takes these two points and creates a box like shape similar to a normal part and uses it as a region. It can then be used to determine if someone is inside of it or not, it can be really useful in some cases.