> 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_vms_multichar.md).

# ESX vms\_multichars

Integration guide for `vms_multichars` on ESX.

***

## Step 1 - Server: inject skin data

Open `vms_multichars/server/main.lua` and find `characters[id] = {` inside `SetupCharacters`.

Paste this code **above** it:

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

***

## Step 2 - Client: load skin in SetupCharacter

Open `vms_multichars/client/main.lua` and find `TriggerEvent('skinchanger:loadSkin', skin)` inside `SetupCharacter`.

Replace with:

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

***

## Step 3 - Client: load skin on character select

In the same file, find this code block in `SetupCharacter`:

```lua
TriggerEvent('skinchanger:loadSkin', Characters[index].skin, function()
    local playerPed = PlayerPedId()
    SetPedAoBlobRendering(playerPed, true)
    ResetEntityAlpha(playerPed)
    SetEntityVisible(playerPed,true)
    if isMenuOpened then
        SetEntityCoords(playerPed, Config.FromRight)
        TaskPedSlideToCoord(playerPed, Config.Spawn.x, Config.Spawn.y, Config.Spawn.z, Config.Spawn.w)
    end
    pedSliding = false
end)
```

Replace with (remove the `TriggerEvent` wrapper and `end)`):

```lua
exports["rcore_clothing"]:setPlayerSkin(Characters[index].skin)
local playerPed = PlayerPedId()
SetPedAoBlobRendering(playerPed, true)
ResetEntityAlpha(playerPed)
SetEntityVisible(playerPed,true)
if isMenuOpened then
    SetEntityCoords(playerPed, Config.FromRight)
    TaskPedSlideToCoord(playerPed, Config.Spawn.x, Config.Spawn.y, Config.Spawn.z, Config.Spawn.w)
end
pedSliding = false
```

***

## Step 4 - Server: register database tables

Open `config/config_server.lua` and find `Config.UsersDatabase`.

Add these entries:

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

***

## Step 5 - Disable custom skin creator

In `config.lua`, set:

```lua
Config.UseCustomSkinCreator = false
```
