Kartik Scripts

ZSX_Multicharacter Setup

This guide shows how to connect kartik-clothing to ZSX_Multicharacter (by ZSX Development).

🛠️ Official File Edits

Only two files in ZSX_Multicharacter need changing. kartik-clothing is added to the appearance detection and gets its own elseif branch, the same way ZSX_Multicharacter already supports its other appearance resources.

1. ZSX_Multicharacter/client/framework/framework_functions.lua

Put kartik-clothing first in the Framework.AppereanceResource detection, so it wins if an old appearance resource is still running:

Framework.AppereanceResource = Config.ForceAppereance ~= false and Config.ForceAppereance or (GetResourceState('kartik-clothing') == 'started' and 'kartik-clothing' or GetResourceState('fivem-appearance') == 'fivem-appearance' and 'fivem-appearance' or --[[ ... existing checks, unchanged ... ]] GetResourceState('qb-clothing') == 'started' and 'qb-clothing')

In Framework.SetSkin, add kartik-clothing to the list of resources that store the model in the skin, and add the branch that applies the skin:

if (Framework.AppereanceResource == 'illenium-appearance' or --[[ ... ]] or Framework.AppereanceResource == 'kartik-clothing') and skinData ~= nil and skinData.model ~= nil then

-- ...

elseif Framework.AppereanceResource == 'kartik-clothing' then
    exports['kartik-clothing']:setPedAppearance(ped, skinData)
end

In Framework.OpenSkinMenu, add the branch that opens the character creator:

elseif Framework.AppereanceResource == 'kartik-clothing' then
    SetPedHeadBlendData(PlayerPedId(), 0, 0, 0, 0, 0, 0, 0, 0, 0, false)
    -- kartik-clothing saves the appearance itself when the creator is confirmed
    exports['kartik-clothing']:startPlayerCustomization(function()
        if Config.Identity.SetInBucketOnAppearance then TriggerServerEvent('ZSX_Multicharacter:Event:SetPlayerState', 'LOG_IN_USER') end
        if UserInterfaceActive then
            exports[ZSX_UI]:HideUI(false)
        end
        HandleHud(false)
    end, { gender = gender })
end

Do not trigger ZSX_Multicharacter:Save:Appereance from this callback. kartik-clothing has already saved the character by the time the callback runs, and it removes any locked items before saving. Saving again through ZSX skips that check and writes to the playerskins / users.skin tables, which kartik-clothing doesn't read.


2. ZSX_Multicharacter/server/functions/characters.lua

In Characters.ConvertSkin, put kartik-clothing first in the appearanceResource detection:

local appearanceResource = Config.ForceAppereance ~= false and Config.ForceAppereance or (GetResourceState('kartik-clothing') == 'started' and 'kartik-clothing' or GetResourceState('skinchanger') == 'started' and 'skinchanger' or --[[ ... existing checks, unchanged ... ]] GetResourceState('rcore_clothing') == 'started' and 'rcore_clothing')

Then add the branch that loads the character preview:

elseif appearanceResource == 'kartik-clothing' then
    skin = exports['kartik-clothing']:getPlayerAppearance(convertedIdentifier)
end

Use the export rather than querying kc_player_skins directly. The export swaps unlisted addon peds (saved as hash:<n>) for the default body, because ZSX_Multicharacter loads models with joaat() and would otherwise hang on the selection screen.

No change is needed in the ZSX_Multicharacter:Save:Appereance handler. kartik-clothing never triggers it.


⚙️ Setup Instructions

  1. Start kartik-clothing before ZSX_Multicharacter in your server.cfg. The client checks which appearance resource is running only once, when it starts:

    ensure ox_lib
    ensure kartik-clothing
    ensure ZSX_Multicharacter
  2. Leave Config.ForceAppereance = false in ZSX_Multicharacter/shared/config.lua so it finds kartik-clothing automatically, or set it explicitly:

    Config.ForceAppereance = 'kartik-clothing'
  3. Config.Identity.SetInBucketOnAppearance works with kartik-clothing. The player is moved back to the default bucket when the character creator is confirmed.

  4. Remove illenium-appearance / fivem-appearance from your server.cfg, then run the migration so existing characters show up on the selection screen.

On this page