In the BuyPowerInvisible, put a ?
before the agent
(th elowercase one) since Triggers can be triggered by stuff like water (which isn’t an agent), you need to put the question mark.
Then, you need to add a ?
after the Agent in the line
InvisiblePlayer := Agent?
That way you get the Agent if a player triggered the trigger and make them invisible