How can I make Brig's repair pack give armor to players?

I’m trying to do a gamenode where when Brig gives an repair pack for other players on her team, they get 75 armor and then armor vanishes after 5 secondes
I am currently using health pools but I think they very confusing (I also limited her to only one repair pack just for a smaller chance of the health pools collapsing)
I just want to make that if Brig heals someone to max health or if she applies a health pack to a full hp hero they get 75 armor no needs for the “the healing that is not used is converted to armor”
My current script is like this:

Event: Ongoing - eachplayer
Team: All
Player:All

Conditons:
Hero Of(Event Player) == Brigitte
Is Using Ability 2(Event Player) == True

Actions
Add Health Pool To Player(Player Closest to Reticle(Event Player, Team Of (Event Player)), Armor, 75, False, False

Wait (5, Ignore Condition)

Remove Health Pool From Player(Last Crated Health Pool)

This works but I need an extra condition that only applies armor if the player is at Max health. (And if is there anyway I can improve this already existing script, please let me know ;-; )

You can check with an if statement in the action list before you apply and remove the amor pool if the targeted players health is equal to their max health if true the action row you have can be executed else you might wanna abort the actions or do something else with the target or the casting brigitte :D.

2 Likes

Oh, I totally forgot about if statements! Thank you so much!

You can also use the Received Healing action, with a condition of Hero Of(Healer) = Hero(Brigitte). I know Player Closest To Reticle isn’t always accurate with the desired target.

I tried that but the “player received healing” event only works with targets that are not full hp. I’m pretty sure it’s impossible to give armor to full hp targets that way.

1 Like

I did not think that far ahead, sorry.

In case you want to improve “player closest to reticle” because it is everything but accurate, you could look into this demonstration code:

You can use this to give your aim a certain width that will still count as “hit”. It is a much more consistent and simple solution than any attempt using angles would be. You can also use this method to recreate “player closest to reticle” as I have demonstrated here:

But I would recommend you to do it the way like I did in the first code, since it gives your aim a certain max width.

Thanls for the help! uwu