So im trying to assign players to a certain role (Survivor),And there is another role called the Beast,I want to know which is the best way to measure how many survivors are alive,And if none of them alive then i'd know (The script would know), I tried making a value,And adding each player's value +1 to the value,And its not really efficient. Anyone has a good answer please?

3 comments

0

Place each player's name into a table and then use a for loop with in pairs to add to a value of how many people are alive. When somebody dies, iterate over the table and using a conditional, check if their name is in the table, if so, remove it.

0

The # Operator could also be used to check the amount of entities in the table without the need of a loop.

0

Can anyone give me an answer in script form though?