Koja Scripts

Exports & Commands

New exports (getClothingImage, getClothingMeta, useClothing, updateMaskFix), category keys, the upstream API, commands and events.

Exports & Commands

Every upstream illenium-appearance export, event and command keeps working. This page lists what the redesign adds and the upstream API you are most likely to call.

Replace illenium-appearance with your folder name if you renamed it.

New exports

getClothingImage

Client and server. Returns the image URL of an item: the Fivemanage URL when there is one, otherwise the file in shots/.

local url = exports['illenium-appearance']:getClothingImage(gender, category, drawable, texture)
ArgumentTypeDescription
gender"male" | "female"Image set
categorystringCategory key, see below
drawablenumberDrawable id
texturenumber?Texture id. Used when the category is captured With textures

Returns nil for an invalid gender or drawable. The URL does not tell you whether the image exists.

getClothingMeta

Server. Returns the metadata used for clothing items — use it to give clothing in any inventory.

local meta = exports['illenium-appearance']:getClothingMeta('male', 'jackets', 4, 0)
Returns
{
    label = "Street Jacket",   -- name from the Capture panel, or "Jackets #4"
    imageurl = "https://...",
    gender = "male",
    category = "jackets",
    kind = "component",        -- "component" | "prop"
    id = 11,                   -- component / prop id
    drawable = 4,
    texture = 0,
    description = "Jackets - M 4 / 0",
}

Returns nil for an unknown category or drawable.

useClothing

Client. The ox_inventory handler of the clothing item (client = { export = 'illenium-appearance.useClothing' }). You do not call it yourself.

updateMaskFix

Client. Runs the mask clipping check on a ped right now. Useful after you change a mask on a ped without the appearance exports.

exports['illenium-appearance']:updateMaskFix(ped) -- ped defaults to the player

Category keys

KeyKindId
maskscomponent1
hairhair2
armscomponent3
pantscomponent4
bagscomponent5
shoescomponent6
accessoriescomponent7
undershirtscomponent8
vestscomponent9
decalscomponent10
jacketscomponent11
hatsprop0
glassesprop1
earsprop2
watchesprop6
braceletsprop7
beardoverlay1

Tattoo zones use tattoo_torso, tattoo_head, tattoo_left_arm, tattoo_right_arm, tattoo_left_leg and tattoo_right_leg.

Upstream exports

All client exports of illenium-appearance are unchanged:

startPlayerCustomization, getPedModel, getPedComponents, getPedProps, getPedHeadBlend, getPedFaceFeatures, getPedHeadOverlays, getPedHair, getPedAppearance, setPlayerModel, setPedHeadBlend, setPedFaceFeatures, setPedHeadOverlays, setPedHair, setPedEyeColor, setPedComponent, setPedComponents, setPedProp, setPedProps, setPlayerAppearance, setPedAppearance, setPedTattoos.

Open the editor from your own script
exports['illenium-appearance']:startPlayerCustomization(function(appearance)
    if appearance then
        TriggerServerEvent('illenium-appearance:server:saveAppearance', appearance)
    end
end, {
    ped = true, headBlend = true, faceFeatures = true, headOverlays = true,
    components = true, props = true, tattoos = true,
})

Commands

CommandWhoWhat it does
/pedmenu [id]AdminOpens the full character creator for you or player id. Needs Config.EnablePedMenu
/skin [id]AdminSame as /pedmenu. More names in Config.Koja.SkinCommands
/shopped [type]AdminCopies a shopkeeper config line for where you stand. type = clothing, barber, tattoo or surgeon
/reloadskinEveryoneReloads your saved skin (cooldown Config.ReloadSkinCooldown)
/clearstuckpropsEveryoneRemoves props stuck to your ped
/joboutfitsEveryoneJob outfits. Needs Config.EnableJobOutfitsCommand
/gangoutfitsEveryoneGang outfits. Needs Config.EnableJobOutfitsCommand
/bossmanagedoutfitsBossESX: manage job outfits. Needs Config.BossManagedOutfits
/migrateskinsConsole / adminESX: converts every old esx_skin skin again. QBCore: /migrateskins [resourceName] imports from qb-clothing (group.god)

"Admin" means the ace in Config.Koja.Capture.AdminGroup or a group from Config.Koja.Capture.FrameworkGroups.

Client events you can trigger

These upstream events open the menus. With the wardrobe hub on, they open the hub.

EventOpens
illenium-appearance:client:openClothingShopMenuClothing shop (pass true for the full creator)
illenium-appearance:client:OpenBarberShopBarber shop
illenium-appearance:client:OpenTattooShopTattoo shop
illenium-appearance:client:OpenSurgeonShopPlastic surgeon
illenium-appearance:client:openOutfitMenuPlayer outfits
illenium-appearance:client:openJobOutfitsMenuJob outfits
illenium-appearance:client:OutfitManagementMenuBoss / gang outfit management
illenium-appearance:client:reloadSkinReloads the saved skin
illenium-appearance:client:ClearStuckPropsClears stuck props
Server side
TriggerClientEvent('illenium-appearance:client:OpenBarberShop', source)

Events the resource sends

EventSideWhen
koja-appearance:client:catalogChangedClientAn admin changed an image, name, price or capture setting. The menu refetches the catalog