Custom role lock please

I spent about 8 hours developing this script to implement my desired role locking system.

My roles include:
Defense (shields)
Enforcer (crowd control)
Support (healers)
Offense (the rest of the heroes)

The lock is supposed to be 1 of each with 5 players, plus Mercy who can swap for Defense or Enforcer. An additional offense with 6 players.

Here is my attempted code: S90EE

I set up a test rule so that when you run the game, you can watch some bots switch between heroes and see how the hero availability changes, however it doesn’t work with real people… and I have no idea why.

Can anyone help?

Hey, I believe I can help you with this
So first is it the same amount of each rule for both teams?

Anyway, you can do it so that you can create a global variable and call them number of offense, number of support, etc. But make sure that there is one for each team so each has a duplicate for their team

Then you create an ongoing rule that has a condition if there is a player playing Lucio(assuming he is in a class) or someone it adds one to the global variable. Then create a second rule that says once that global variable equals the max(1 I think from your explanation) or whatever number disallow all the players in the class.

Sorry if this is confusing I know this is tricky, but if you need a further elaboration I am happy to help just let me know.

1 Like