> For the complete documentation index, see [llms.txt](https://docs.streamavatars.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.streamavatars.com/lua-scripting-api/api-reference-and-tips/events/battleroyale-outcome.md).

# BattleRoyale Outcome

```lua
function yourEvent(winner, earnings)
     log('the winner is: ' .. winner.displayName);
     log('earnings: ' .. earnings); --earnings does not include lootbox
end

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

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