SHOPPING CART

Onex

Command Palette

Search for a command to run...

ESX INTEGRATION#

onex-creation provides full ESX compatibility, replacing esx_skin and skinchanger with enhanced features while maintaining backward compatibility.

Overview#

When using ESX, onex-creation:

  • Handles all esx_skin and skinchanger events
  • Uses ESX's money system for purchases
  • Integrates with ESX player data for appearance storage

Requirements#

Ensure these resources are running:

server.cfg
ensure es_extended ensure ox_lib ensure onex-base ensure onex-interaction ensure onex-creation

Remove or comment out esx_skin and skinchanger from your server.cfg. onex-creation replaces them completely.

Framework Detection#

Framework is automatically detected:

modules/framework/shared/framework.lua
-- Auto-detection via GlobalState -- GlobalState.xframework = 'esx' (set by onex-base)

Replaced Events#

onex-creation handles these ESX skin events:

EventDescription
skinchanger:loadSkinLoad saved appearance
esx:playerLoadedPlayer loaded handler
esx_skin:openSaveableMenuOpen saveable clothing menu
skinchanger:loadDefaultModelLoad default ped model

Load Skin#

Your Script
-- Load saved appearance TriggerEvent('skinchanger:loadSkin', skin) -- Or use onex-creation directly TriggerEvent('onex-creation:client:loadPedSkin', skin)

Player Loaded#

Your Script
-- ESX player loaded event RegisterNetEvent('esx:playerLoaded') AddEventHandler('esx:playerLoaded', function(xPlayer) -- onex-creation automatically handles appearance loading end)

Open Saveable Menu#

Your Script
-- Open menu with save callback TriggerEvent('esx_skin:openSaveableMenu', function(data, menu) -- Callback when saved end, function(data, menu) -- Callback when cancelled end) -- Or use onex-creation directly exports['onex-creation']:openCreationMenu('clothes', function(appearance) -- Callback with saved appearance end)

Load Default Model#

Your Script
-- Load default model TriggerEvent('skinchanger:loadDefaultModel', isMale) -- Or use onex-creation exports['onex-creation']:LoadPedModel(PlayerPedId(), isMale and 'mp_m_freemode_01' or 'mp_f_freemode_01')

Money Integration#

Purchases use ESX's money system:

modules/framework/server/esx.lua
-- onex-creation automatically uses: xPlayer.removeMoney(amount) -- Falls back to bank if insufficient cash xPlayer.removeAccountMoney('bank', amount)

Player Data Storage#

Appearance is stored in ESX's users table or onex-creation's own tables:

ESX Integration
-- Can use ESX's skin column -- Or onex-creation's player_outfits table

Character Creation Integration#

esx_identity Integration#

esx_identity Integration
-- When creating new character via esx_identity RegisterNetEvent('esx_identity:completedRegistration') AddEventHandler('esx_identity:completedRegistration', function() -- Open character creation TriggerEvent('onex-creation:client:CreateNewChar') end)

Multichar Integration#

Works with esx multicharacter:

Multichar Script
-- After selecting character TriggerEvent('skinchanger:loadSkin', skin) -- onex-creation handles this

Job Outfits#

Configure job outfits for ESX jobs:

config/shop.lua
Shop.JobOutfits = { ["police"] = { label = "Los Santos Police", outfits = { { label = "Cadet Uniform", minGrade = 0, -- ESX job grade outfit = { torso = { collection = "base", localIndex = 55, texture = 0 }, pants = { collection = "base", localIndex = 25, texture = 0 }, shoes = { collection = "base", localIndex = 10, texture = 0 } } }, { label = "Officer Uniform", minGrade = 1, outfit = { ... } }, { label = "Sergeant Uniform", minGrade = 2, outfit = { ... } } } }, ["ambulance"] = { label = "Emergency Medical Services", outfits = { ... } } }

ESX Exports#

onex-creation provides ESX-compatible exports:

Your Script
-- These work the same as original esx_skin exports['onex-creation']:loadSkin(skin) exports['onex-creation']:setModel(model)

Common ESX Integrations#

esx_shops#

Replace esx_shops clothing interaction:

Your Script
-- Instead of esx_shops clothing exports['onex-creation']:openCreationMenu('clothes')

esx_society#

Integrate with esx_society for job clothing:

Your Script
-- In job script RegisterNetEvent('esx_society:openBossMenu') AddEventHandler('esx_society:openBossMenu', function() -- Add clothing option TriggerEvent('onex-creation:openOutfitMenu') end)

esx_jobs#

esx_policejob or similar
-- When going on duty RegisterNetEvent('esx_policejob:onDuty') AddEventHandler('esx_policejob:onDuty', function() TriggerEvent('onex-creation:client:JobOutifit', 'police') end)

Notifications#

modules/framework/shared/framework.lua
Framework.Notify = { name = 'onex-interaction' -- Uses onex notifications -- Or configure for esx_notify }

Next Steps#