> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_clothing/api/client.md).

# Client

All client-side events, triggers, and exports for `rcore_clothing`.

***

## Events

<details>

<summary>onClothingShopOpened</summary>

Fires before the clothing shop UI opens.

```lua
AddEventHandler('rcore_clothing:onClothingShopOpened', function()
    -- do something before shop opens
end)
```

</details>

<details>

<summary>onClothingShopClosed</summary>

Fires after the clothing shop UI closes.

```lua
AddEventHandler('rcore_clothing:onClothingShopClosed', function()
    -- do something after shop closes
end)
```

</details>

<details>

<summary>afterSkinLoaded</summary>

Fires when the player's skin is applied - on spawn or after `/reloadskin`.

```lua
AddEventHandler('rcore_clothing:afterSkinLoaded', function()
    -- do something after skin is loaded
end)
```

</details>

<details>

<summary>charcreator:done</summary>

Fires when the player completes the character creator.

```lua
AddEventHandler('rcore_clothing:charcreator:done', function()
    -- do something after character creator is finished
end)
```

</details>

<details>

<summary>onItemPurchase</summary>

Fires when a player buys a clothing item.

{% hint style="warning" %}
This script does not support clothing as items. Do not use this event to build an item-based integration.
{% endhint %}

```lua
---@param componentId number
---@param drawableId number
---@param textureId number
---@param label string

AddEventHandler('rcore_clothing:onItemPurchase', function(componentId, drawableId, textureId, label)
    print('Purchased item: ' .. componentId .. ' ' .. drawableId .. ' ' .. textureId .. ' ' .. label)
end)
```

</details>

***

## Triggers

<details>

<summary>reapplyDecorations</summary>

Re-applies clothing decorations. The script already preserves non-clothing decorations when clearing, so this is rarely needed.

```lua
TriggerEvent('rcore_clothing:reapplyDecorations')
```

</details>

<details>

<summary>reloadSkin</summary>

Reloads the player's skin from the database.

```lua
TriggerServerEvent('rcore_clothing:reloadSkin')
```

</details>

<details>

<summary>saveCurrentSkin</summary>

Saves the player's current skin to the database.

```lua
TriggerEvent('rcore_clothing:saveCurrentSkin')
```

</details>

<details>

<summary>openChangingRoom</summary>

Shows the player's purchased clothes and saved outfits.

```lua
TriggerEvent('rcore_clothing:openChangingRoom')
```

</details>

<details>

<summary>openClothingShopWithEverythingAndFree</summary>

Opens a shop with all items available for free. Intended for admins.

```lua
TriggerEvent('rcore_clothing:openClothingShopWithEverythingAndFree')
```

</details>

<details>

<summary>openShop</summary>

Opens a specific clothing shop for the player.

```lua
---@param shopType string   - shop type from config (binco, suburban, etc.) or any custom type
---@param shopConfig? table - optional shop config, see Shop Configs docs

TriggerEvent('rcore_clothing:openShop', shopType, shopConfig)
```

</details>

<details>

<summary>openJobChangingRoom</summary>

Opens a job changing room. Outfits must be created first using the [Outfit Editor](/paid-resources/rcore_clothing/features/admin_mode.md#outfit-editor).

```lua
---@param jobName string    - job name (police, ambulance, etc.)
---@param shopConfig? table - optional shop config, see Shop Configs docs

TriggerEvent('rcore_clothing:openJobChangingRoom', jobName, shopConfig)
```

</details>

***

## Exports

<details>

<summary>getSkinByIdentifier</summary>

Returns the saved skin data for a player identifier.

```lua
local skin = exports['rcore_clothing']:getSkinByIdentifier(identifier)
```

</details>

<details>

<summary>getPlayerSkin</summary>

Returns the player's current skin. Set `includeCharacter` to `true` to include face, hair, etc.

```lua
---@param includeCharacter bool - true = clothing + character data, false = clothing only

local skin = exports['rcore_clothing']:getPlayerSkin(includeCharacter)
```

</details>

<details>

<summary>setPlayerSkin</summary>

Applies a skin to the player. Set `forceReload` to `true` to respawn the ped.

```lua
---@param skin table
---@param forceReload bool

exports['rcore_clothing']:setPlayerSkin(skin, forceReload)
```

</details>

<details>

<summary>setPedSkin</summary>

Applies a skin to any ped.

```lua
---@param ped number
---@param skin table

exports['rcore_clothing']:setPedSkin(ped, skin)
```

</details>

<details>

<summary>fixArms</summary>

Attempts to set the correct arm model for the player's current top. Not 100% accurate, but handles most cases.

```lua
exports['rcore_clothing']:fixArms()
```

</details>

<details>

<summary>getPlayerClothing</summary>

Returns only clothing data (no character features). The result can be passed to `setPedSkin`.

```lua
local playerClothing = exports['rcore_clothing']:getPlayerClothing()
```

</details>
