How to use TriggeredEvent

You need to confirm that the optional MaybeAgent is valid and then you need to access the agent from the optional. Once you do this, then you can use that agent as the variable for the functions. eg:

OnTrggerSwitchTriggered(MaybeAgent : ?Agent): void = 

if (Agent := MaybeAgent?):
    HudData.SeccessHud.Show(Agent)
    EquipPet(Agent)