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

# cui\_character

{% hint style="danger" %}
Adding new fonts is recommended ONLY for experienced developers!
{% endhint %}

### cui\_character

cui\_character have troubles with skinchanger bridge, which is why you may need to do following changes.

**server/main.lua**

```lua
    RegisterServerEvent('esx_skin:save')
    AddEventHandler('esx_skin:save', function(data)
        charSave(data, source)
    end)

    RegisterServerEvent('cui_character:save')
    AddEventHandler('cui_character:save', function(data)
        charSave(data, source)
    end)

    function charSave(data, Source)
        local xPlayer = ESX.GetPlayerFromId(Source)

        if ESX.GetConfig and ESX.GetConfig().Multichar and xPlayer == nil then
            charSkins[Source] = data
            return
        else
            charSkins[Source] = nil
        end

        MySQL.ready(function()
            MySQL.Async.execute('UPDATE users SET skin = @data WHERE identifier = @identifier', {
                ['@data'] = json.encode(data),
                ['@identifier'] = xPlayer.identifier
            })
        end)
    end
```

**client/main.lua**

```lua
RegisterNetEvent('skinchanger:loadSkin')
AddEventHandler('skinchanger:loadSkin', function(skin, cb)
    local newSkin = GetDefaultCharacter(skin.sex == 0)

    for key, value in pairs(currentChar) do
        if newSkin[key] then
            newSkin[key] = value
        end
    end

    for key, value in pairs(skin) do
        if newSkin[key] then
            newSkin[key] = value
        end
    end

    UpdateClothes(newSkin)
    LoadCharacter(newSkin, cb)
end)
```

```lua
function LoadModel(hash)
    isModelLoaded = false
    local playerPed = PlayerPedId()

    if GetEntityModel(playerPed) == hash then
        isModelLoaded = true
        return
    end

    SetEntityInvincible(playerPed, true)

    if IsModelInCdimage(hash) and IsModelValid(hash) then
        RequestModel(hash)
        while not HasModelLoaded(hash) do
            Citizen.Wait(0)
        end
        SetPlayerModel(PlayerId(), hash)
        FreezePedCameraRotation(playerPed, true)
    end
    SetEntityInvincible(playerPed, false)

    isModelLoaded = true
    if not Config.StandAlone then
        TriggerEvent('skinchanger:modelLoaded')
    end
end
```

**There are another ways around it, you can get a pre-done version :)**

{% embed url="<https://github.com/Xogy/cui_character>" %}
