# Multichar integration guide

{% hint style="danger" %}
This guide is only for multicharacter authors to integrate rcore\_clothing with their system. If you are not a multicharacter author, you can ignore this guide.
{% endhint %}

This guide will help you integrate rcore\_clothing with your multicharacter system.

## Step 1 - Getting the skin

In your multicharacter system, you will need to get the skin of the character. For that you will need to call the `getSkinByIdentifier` function from rcore\_clothing and pass the identifier of the character.

* this event can be called either on client or server side
* return structure is a table with `ped_model` and `skin` keys

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

## Step 2 - Setting the skin

After you have the skin, you will need to set it on the player. For that you will need to call the `setPedSkin` function from rcore\_clothing and pass the ped and the skin.

```lua
exports.rcore_clothing:setPedSkin(ped, skin)
```

## Step 3 - Opening the char creator

Character creator can be opened by calling the following events (which your multichar probably already calls)

**ESX:**

```lua
TriggerEvent('esx_skin:resetFirstSpawn')
TriggerEvent('esx_skin:playerRegistered')
```

**QBCore:**

```lua
TriggerEvent('qb-clothes:client:CreateFirstCharacter')
```

**Or open directly:**

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