# Duel Outcome

```lua
function yourEvent(winner, loser, earnings, initiator) --if winner and loser are == nil, then the duel was cancelled.
    log(initiator.displayName .. ' started this duel...');
    log('the winner is: ' .. winner.displayName .. ' and the loser is: ' .. loser.displayName);
    log('earnings: ' .. earnings); --earnings does not include lootbox
end

return function()
    addEvent('duelOutcome', 'yourEvent');
    keepAlive();
end
```

{% hint style="info" %}
Events are asynchronous coroutines.
{% endhint %}
