Scripts Guides
Exports & Events
Client

EXPORTS & EVENTS

This guide covers events and exports for the onex-creation script, helping you manage menus, data fetching, and player models.

OPEN MENU

Open the creation menu using this event or export.

Parameters

  • type (string): Menu type to open.

Available Menu Types

You can find available types in onex-creation/shared/shop.lua under Shop.Types.

  • newchar
  • admin
  • clothes
  • barber
  • tattoos
  • family_edit
-- type: string
TriggerEvent('onex-creation:client:openCreationMenu', type)

RELOAD PLAYER SKIN

Reload the player’s current clothes and model.

Parameters

  • reloadModel (boolean): If true, reloads the model and skin. If false, only reloads the skin if the player’s model matches the database.
-- reloadModel: boolean (false/true)
TriggerEvent('onex-creation:syncClothes', reloadModel)

FETCH PLAYER MODEL

Retrieve the player model.

-- Returns: string (Player model)
exports["onex-creation"]:FetchPlayerModel()

FETCH PLAYER CLOTHES

Retrieve player clothing data (skindata).

Fetch Player Clothes (From Cache)

Retrieves clothing data directly from the cache.

-- Returns: table
exports["onex-creation"]:FetchPlayerClothes()

LOAD PED MODEL

Change the model of any player or ped.

Parameters

  • model (string): Model name (no hash needed).
  • ped (number, optional): Player/ped model to change (defaults to player).
-- model: string, ped: number (optional, defaults to player)
exports["onex-creation"]:LoadPedModel(model, ped)

LOAD PED SKIN

Change the skin of any player or ped.

Parameters

  • skinData (table): Skin data to apply.
  • ped (number, optional): Player/ped to apply the skin to (defaults to player).
-- skinData: table, ped: number (optional, defaults to player)
exports["onex-creation"]:LoadPedSkin(skinData, ped)

DETECT IS NEW PLAYER MENU CLOSED

Triggered when the new character creation menu is closed (save or cancel).

Parameters

  • type (string):
    • save: When the player saves.
    • cancel: When the player cancels.
RegisterNetEvent('onex-creation:onClothingFirstCharacterMenuClose', function(type)
    -- Your code here
end)

DETECT IS MENU CLOSED

Triggered every time the onex-creation menu is closed (save or discard).

Parameters

  • type (string):
    • save: When the player saves.
    • cancel: When the player cancels.
RegisterNetEvent('onex-creation:onClothingMenuClose', function(type)
    -- Your code here
end)

LOAD PRE-SELECTED OUTFITS

Customize a player’s outfit, persisting it through crashes or exits if Shop.PersistUniforms is enabled.

Parameters

  • skin (table): Skin data to apply.
  • isPersistUniforms (boolean): Override Shop.PersistUniforms setting.

It will save the outfit so in crash or leaving city wont lose the outfit if this option is true.

-- skin: table, isPersistUniforms: boolean
TriggerEvent('onex-creation:client:loadCustomOutfit', skin, isPersistUniforms)

Example Usage

local skin = {
    ["pants"] = { item = 24, texture = 0 },
    ["arms"] = { item = 19, texture = 0 },
    ["shirt"] = { item = 58, texture = 0 },
    ["vest"] = { item = 0, texture = 0 },
    ["torso"] = { item = 55, texture = 0 }
}
TriggerEvent('onex-creation:client:loadCustomOutfit', skin, true)

GET CLOTHES PREVIEW

Retrieve preview images for specific clothing items.

Parameters

  • type (string): Value -> ('clothing', 'prop', 'overlays', or 'others').
  • component (string): Specific component (e.g., 'torso', 'hat' , 'makeup').
  • item (number): Item index number.
-- Returns: string (preview image URL)
exports["onex-creation"]:FetchPlayerClothes(type, component, item)