Can't call function after replacing "()" with "(Agent : agent)"

Hello there! I am new to coding and currently making a Loadout System. I needed to EventBind the LoadoutGranters to my teleporters (marked yellow at the bottom). In order to write “ChooseLoadout1” behind the “Subscribe”, I had to add “Agent : agent” into the function “ChooseLoadout1():void=” (marked yellow in the middle). Before I changed it, the yellow marked “ChooseLoadout1” at the top was “ChooseLoadout1()”. I figured that I had to remove the parentheses because they were underlined red. The problem that I have now is, that the function “ChooseLoadout1(Agent : agent):void=” isn’t triggered by the top “ChooseLoadout1” anymore and therefore my LoadoutGranters won’t activate.

Does any skilled programmer know what I did wrong and what I have to do in order for the Granters to work again? Would be much appreciated <3!

you added parameter to your function so now you have to call it with a parameter like chooseLoadout(agent)

prolly you’ll need a way around that ‘?’ but it’s been a while since I did anything in uefn so that’s all from me :saluting_face:

If I would add an “?” to “ChooseLoadout1(Agent : agent):void=”, it would make it incompatible with the Subscibe function. I am not sure if that’s what you meant tho

It is hard to tell what you’re doing from the code provided, but usually the ?agent is associated with the Trigger Device, so I’m guessing you’ve got a Trigger Device somewhere in the scene. If you are new to coding, the ?agent can be confusing. What I would suggest is to use the Mutator Zone Device instead of the Trigger Device. It has the same functionality and even more. The Mutator Zone only uses agent, and not ?agent like the Trigger Device. Then you don’t have to use ?agent at all.

if(_Agent := Agent?):
    ChooseLoadout1(_Agent)

If you omit the parenthesis you’re not calling a function, you’re just retrieve its reference