> 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/integration/esx_multicharacter.md).

# esx\_multicharacter

Integration guide for `esx_multicharacter` **v1.10.9 and newer**.

{% hint style="warning" %}
If this doesn't match your version, try the [older integration](/paid-resources/rcore_clothing/integration/esx_multicharacter_old.md).
{% endhint %}

***

## Step 1 - Server: inject skin data

Open `esx_multicharacter/server/modules/multicharacter.lua` and find `characters[id] = {` inside `SetupCharacters`.

Place this code **above** that line:

```lua
if GetResourceState("rcore_clothing") == "started" then
    if v then
        v.skin = json.encode(exports["rcore_clothing"]:getSkinByIdentifier(v.identifier))
    else
        print("ERROR: Unknown version of multichar")
    end
end
```

***

## Step 2 - Client: load skin on character switch

Open `esx_multicharacter/client/modules/multicharacter.lua` and find `TriggerEvent("skinchanger:loadSkin", newCharacter.skin)` inside `Multicharacter:ChangeExistingPed()`.

Replace it with:

```lua
if newCharacter.skin and newCharacter.skin.skin then
    exports["rcore_clothing"]:setPlayerSkin(newCharacter.skin)
else
    TriggerEvent("skinchanger:loadSkin", newCharacter.skin)
end
```

***

## Step 3 - Client: apply skin on temp ped spawn

In the same file, find `Multicharacter:SpawnTempPed()` and inside it find:

```lua
ESX.SpawnPlayer(skin, self.spawnCoords, function()
    DoScreenFadeIn(600)
    self.playerPed = PlayerPedId()
end)
```

Replace with:

```lua
ESX.SpawnPlayer(skin, self.spawnCoords, function()
    DoScreenFadeIn(600)
    self.playerPed = PlayerPedId()
    exports["rcore_clothing"]:setPlayerSkin(skin)
end)
```

***

## Step 4 - Client: get skin on player load

In the same file, find `Multicharacter:PlayerLoaded()` and inside it find:

```lua
skin = exports["skinchanger"]:GetSkin()
```

Replace with:

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

***

## Step 5 - Server: register database tables

Open `esx_multicharacter/server/modules/database.lua` and find `Database.tables = { users = "identifier" }`.

Add these entries:

```lua
["rcore_clothing_current"] = "identifier",
["rcore_clothing_purchased"] = "identifier",
["rcore_clothing_outfits"] = "identifier",
```

Result should look like:

```lua
Database.tables = {
    users = "identifier",
    ["rcore_clothing_current"] = "identifier",
    ["rcore_clothing_purchased"] = "identifier",
    ["rcore_clothing_outfits"] = "identifier",
}
```
