Hi,
im using guard_spawner_devices, and i have a playermap, and a @editables storing the Guard spawners
basically i want to disable guardspawners when there are more than real players
i want to use an if statement like
total players = amount of players
if total players = 3 or more disable guardspawner
elif total players = 4 or more disable guardspawner2
elif total players = 5 or more disable guardspawner3
elif total players = 6 or more disable guardspawner4
else guardspawner, guardspawner2, guardspawner3, guardspawner4 = enable
not sure how to actually code this, having a hard time going from python3 to verse
a better way is probably a for or while loop to do it,
only want it for 4 bots
gone with 4 separate if statements keeps it as individual events which i kind of like.
not if below is correct or what im missing
my attempt so far at this:
@editable
var Guards : []guard_spawner_device = array{}
var TotalPlayers : PlayerMap.Length
if (TotalPlayers := >3):
Guards[0].disable()
else: Guards[0].enable()
if (TotalPlayers := >4):
Guards[2].disable()
else: Guards[2].enable()
if (TotalPlayers := >5):
Guards[3].disable()
else: Guards[3].enable()
if (TotalPlayers := >6):
Guards[4].disable()
else: Guards[4].enable()