> For the complete documentation index, see [llms.txt](https://docs.tmc.bj/v2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tmc.bj/v2/tmc-core-object/events/client.md).

# Client

## TMC:Client:OnPlayerLoaded

Triggered when the player data has fully loaded

## TMC:Client:OnPlayerSpawned

Triggered when the player is fully spawned in the world

## TMC:Client:OnPlayerUnloaded

Triggered when the player unloads - this can be on `/logout` or leaving

## TMC:Client:LocalOutOfCharacter

Triggered when the player receives a local OOC message

```lua
-- sourcePos: position of the player submitting the message
-- playerName: display name of the player
-- message: message content
```

## TMC:Client:TriggerServerCallback

Triggered on use of a server callback and runs the set callback function

{% hint style="warning" %}
This is a framework utility event and shouldn't used in general scripting
{% endhint %}

```lua
-- name: server callback anme
-- cbId: callback unqiue id
-- agruments...
```

## TMC:Client:TriggerServerCallback

Triggered on use of a server callback and runs the set callback function

```lua
-- name: server callback anme
-- cbId: callback unqiue id
-- agruments...
```

## TMC:Client:UseItem

Triggered when an item is used, this is then sent to the server.

{% hint style="warning" %}
This is a framework utility event and shouldn't used in general scripting
{% endhint %}

```lua
-- item: name
-- slotIndex: index of the item
```

## TMC:Client:DeleteVehicleReceived

Triggered when removing a vehicle

{% hint style="warning" %}
This is a framework utility event and shouldn't used in general scripting
{% endhint %}

```lua
-- veh: network vehicle id
```

## TMC:Client:DeleteEntityReceived

Triggered when removing a entity

{% hint style="warning" %}
This is a framework utility event and shouldn't used in general scripting
{% endhint %}

```lua
-- id: network entity id
```

## TMC:Client:Clipboard

Shows a UI allowing a player to copy data to their clipboard.

```lua
-- data: data to be presented/copied
-- title: title of the data (not coppied)
```

## TMC:Client:SyncPlayers

Used to sync player data between players

{% hint style="warning" %}
This is a framework utility event and shouldn't used in general scripting
{% endhint %}

```lua
-- players: array of player data
```

## TMC:Client:AddPlayer

Used to add a player's data to the client's player cache

{% hint style="warning" %}
This is a framework utility event and shouldn't used in general scripting
{% endhint %}

```lua
-- src: player's source
-- ply: player's data
```

## TMC:Client:RemovePlayer

Used to remove a player's data to the client's player cache

{% hint style="warning" %}
This is a framework utility event and shouldn't used in general scripting
{% endhint %}

```lua
-- src: player's source
```

## TMC:Client:SetCitizenId

Used to update the client's player cache with the player's selected citizenid

{% hint style="warning" %}
This is a framework utility event and shouldn't used in general scripting
{% endhint %}

```lua
-- src: player's source
-- citizenid: player's citizenid
```

## TMC:Client:ToggleHud

Toggle the player's HUD

```lua
-- reason: reason for hiding HUD
```
