Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Getting how many players are survivors Help?

Asked by
iLegitus 130
10 years ago

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?

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. FearMeIAmLag 1161 — 10y
0
The # Operator could also be used to check the amount of entities in the table without the need of a loop. RaverKiller 668 — 10y
0
Can anyone give me an answer in script form though? iLegitus 130 — 10y

Answer this question