This function parameter expects a value of type agent->void, but this argument is an incompatible value of type ?agent->void.

Actually your problem is the opposite issue, so you just gotta remove the ? from your method definition. This is because the Guard.CompletedEvent can only be instigated by an agent, therefore it is impossible to pass an ?agent to it. Which is what you define as possible in your “TestPlayerElimination(Agent: ?agent)” method by having the ? before the agent type.