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

# codem\_multichar

Integration guide for `codem_multichar`.

***

## Step 1 - Config

In config, set:

```lua
Config.Clothes = "rcore_clothing"
```

***

## Step 2 - Client: detect clothing system

Open `config/clothes.lua` and add this between `if` and `Config.Clothes == "default"` on \~line 2:

```lua
Config.Clothes == 'rcore_clothing' or
```

***

## Step 3 - Client: parse skin data

In the same file, find (\~line 10):

```lua
if Config.Clothes == 'illenium-appearance' then
    characterData = json.decode(characterData)
    model = characterData['model']
```

Replace with:

```lua
if Config.Clothes == 'rcore_clothing' then
    model = characterData.model
    characterData = characterData.skin
elseif Config.Clothes == 'illenium-appearance' then
    characterData = json.decode(characterData)
    model = characterData['model']
```

***

## Step 4 - Client: apply skin to ped

Find (\~line 100):

```lua
if Config.Clothes == 'fivem-appearance' then
    exports['fivem-appearance']:setPedAppearance(createdPeds[citizenid], characterData)
```

Replace with:

```lua
if Config.Clothes == 'rcore_clothing' then
    exports.rcore_clothing:setPedSkin(createdPeds[citizenid], characterData)
elseif Config.Clothes == 'fivem-appearance' then
    exports['fivem-appearance']:setPedAppearance(createdPeds[citizenid], characterData)
```

***

## Step 5 - Server (ESX): get skin

Open `editable/serverframework/esx.lua` and find `RegisterCallback("m-multichar:server:getSkin", function(source, cb, cid)`.

Add this code after `local src = source`:

```lua
if (Config.Clothes == 'rcore_clothing') then
    local skin = exports.rcore_clothing:getSkinByIdentifier(cid)
    cb({
        model = skin.ped_model,
        skin = skin.skin,
    })
    return
end
```

In the same file, find `skin = Appearance[Config.Clothes][playerData.sex or 'm']` and replace with:

```lua
local defaultSkin = Appearance[Config.Clothes] or Appearance['default']
skin = defaultSkin[playerData.sex or 'm']
```

***

## Step 6 - Server (QBCore): get skin

Open `editable/serverframework/qb.lua` and find `if (Config.Clothes == "default") then`.

Replace with:

```lua
if (Config.Clothes == 'rcore_clothing') then
    local skin = exports.rcore_clothing:getSkinByIdentifier(cid)
    cb({
        model = skin.ped_model,
        skin = skin.skin,
    })
elseif (Config.Clothes == "default") then
```
