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)
endIn 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 })
endDo not trigger
ZSX_Multicharacter:Save:Appereancefrom 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 theplayerskins/users.skintables, 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)
endUse the export rather than querying
kc_player_skinsdirectly. The export swaps unlisted addon peds (saved ashash:<n>) for the default body, becauseZSX_Multicharacterloads models withjoaat()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
-
Start kartik-clothing before
ZSX_Multicharacterin yourserver.cfg. The client checks which appearance resource is running only once, when it starts:ensure ox_lib ensure kartik-clothing ensure ZSX_Multicharacter -
Leave
Config.ForceAppereance = falseinZSX_Multicharacter/shared/config.luaso it finds kartik-clothing automatically, or set it explicitly:Config.ForceAppereance = 'kartik-clothing' -
Config.Identity.SetInBucketOnAppearanceworks with kartik-clothing. The player is moved back to the default bucket when the character creator is confirmed. -
Remove
illenium-appearance/fivem-appearancefrom yourserver.cfg, then run the migration so existing characters show up on the selection screen.