> For the complete documentation index, see [llms.txt](https://wosa.gitbook.io/working-with-wosa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wosa.gitbook.io/working-with-wosa/events/server/user.md).

# User

Server events that are in some way related to the user aspects.

### On user connect

This event is **triggered** when a user is connecting to the server.&#x20;

{% tabs %}
{% tab title="playerID" %}
The server id of the user who is connecting to the server.
{% endtab %}

{% tab title="playerLicense" %}
The **r\*** license of the user who is connecting.
{% endtab %}

{% tab title="playerRank" %}
The rank of the user who is connecting.
{% endtab %}

{% tab title="isPlayerNew" %}
A **bool** of is it the first time the player is connecting to this server?
{% endtab %}
{% endtabs %}

```lua
AddEventHandler('__WOSA:SERVER:USER_CONNECTING', function(playerID, playerLicense, playerRank, isPlayerNew)

end)
```

### On user leave

This event is **triggered** when a user is leaving the server.

{% tabs %}
{% tab title="playerID" %}
The server id of the user who is connecting to the server.
{% endtab %}

{% tab title="playerLicense" %}
The **r\*** license of the user who is connecting.
{% endtab %}

{% tab title="playerRank" %}
The rank of the user who is connecting.
{% endtab %}

{% tab title="leaveReason" %}
The reason why the user left, by the system.
{% endtab %}
{% endtabs %}

```lua
AddEventHandler('__WOSA:SERVER:USER_LEAVING', function(playerID, playerLicense, playerRank, leaveReason)

end)
```
