SHOPPING CART

Onex

Command Palette

Search for a command to run...

CONFIGURATION#

All configuration is done in config/config.lua. This page covers every option with detailed explanations and examples.

CORE SETTINGS#

Enable Jail Check#

config/config.lua
Config.EnableJailCheck = true

Description: Determines whether the spawn selector checks if a player is currently jailed.

  • true (default): If player is jailed, spawn selector is skipped and they remain in jail
  • false: Spawn selector always appears, even if jailed (can break jail scripts)

Only set to false if your server doesn't support jail persistence or you're using a custom jail system.

Enable Last Location#

config/config.lua
Config.EnableLastLocation = true

Description: Allows players to spawn at their last logout location.

  • true (default): "Last Location" option appears in spawn selector
  • false: Players must always choose from defined spawn points

How it works:

  • Retrieves player's coordinates from last logout
  • Generates camera preview automatically
  • Shows as first option in spawn selector
@OnexScripts
Configuration Tip

Enabling last location provides a better player experience, allowing them to continue where they left off!

156 likes23 reposts12 bookmarks

Default VRP Spawn#

config/config.lua
Config.DefaultVRPSpawn = vector3(-206.2997, -1014.8234, 30.1381)

Description: Fallback spawn location for VRP framework when last location cannot be retrieved.

  • Only used with VRP framework
  • Other frameworks (QB, ESX) use their own fallback systems
  • Change this to your server's default spawn point

SPAWN LOCATIONS#

Main Configuration Structure#

config/config.lua
Settings.Locations = { FirstTitle = 'CHOOSE YOUR SPAWN', SecondTitle = "LET'S BEGIN", { name = 'trainstation', label = 'Train Station', coords = vector3(-223.3253, -996.7120, 34.0096), rot = vector3(0, 0, -139.7158), spawn = vector4(-206.3010, -1014.7507, 30.1381, 71.0018), image = 'trainstation.webp' -- job = {'police'} -- Optional }, -- More locations... }

Location Properties Explained#

PropertyTypeRequiredDescription
namestring✅ YesUnique identifier for the spawn location
labelstring✅ YesDisplay name shown in UI
coordsvector3✅ YesCamera position for preview
rotvector3✅ YesCamera rotation (pitch, roll, yaw)
spawnvector4✅ YesPlayer spawn coords (x, y, z, heading)
imagestring✅ YesImage filename (must be in web/assets/)
jobtable❌ NoRestrict to specific jobs (e.g., {'police', 'ems'})
customspawnboolean❌ NoTrigger custom spawn logic via DoCustomSpawn()

UI Titles#

FirstTitle = 'CHOOSE YOUR SPAWN' SecondTitle = "LET'S BEGIN"
  • FirstTitle: Main heading displayed in spawn selector
  • SecondTitle: Subtitle or secondary text
  • Customize these to match your server's theme

Adding New Spawn Locations#

Get Camera Coordinates#

Use the debug command to get camera position and rotation:

/onxcaminfo

💡 TIP — This command only works when onex_debug = true in onex-base config.

Position Your Character#

  1. Stand where you want the camera to be
  2. Face the direction you want the camera to look
  3. Run /onxcaminfo command
  4. Copy the coords and rotation from F8 console

Add to Config#

config/config.lua
{ name = 'myspawn', label = 'My Custom Spawn', coords = vector3(x, y, z), -- Camera position from /onxcaminfo rot = vector3(rx, ry, rz), -- Camera rotation from /onxcaminfo spawn = vector4(sx, sy, sz, h), -- Where player spawns image = 'myspawn.webp' -- Image in web/assets/ }

Add Image#

Place your spawn location image in:

onex-spawn/web/assets/myspawn.webp

Recommended format: WebP (better compression)

Job-Restricted Spawns#

Restrict certain spawn locations to specific jobs:

config/config.lua
{ name = 'policestation', label = 'Police Station', coords = vector3(440.5, -981.2, 30.6), rot = vector3(0, 0, 90), spawn = vector4(442.1, -982.0, 30.6, 180.0), image = 'policestation.webp', job = {'police', 'sheriff'} -- Only police and sheriff can spawn here }

How it works:

  • Script checks player's job on spawn selector load
  • If job doesn't match, spawn is disabled in UI
  • Works with all frameworks (QB, ESX, VRP)

Job names must match your framework's job naming convention (e.g., 'police' for QB, 'police' for ESX).

QB-APARTMENTS LOCATIONS#

If you're using qb-apartments, configure apartment spawn points:

config/config.lua
Settings.QBApartmentsLocations = { FirstTitle = 'CHOOSE YOUR DESIRED APARTMENT', SecondTitle = 'APARTMENT SELECT', { name = 'apartment1', label = 'South Rockford Drive', coords = vector3(-690.5970, -1090.0488, 21.1570), rot = vector3(0, 0, -115.7110), spawn = vector4(-677.6673, -1099.8654, 14.5361, 99.3977), image = 'southrockford.PNG', customspawn = true }, { name = 'apartment2', label = 'Morningwood Blvd', coords = vector3(-1261.2889, -426.6606, 45.1381), rot = vector3(0, 0, -106.7638), spawn = vector4(-1281.2041, -425.4779, 34.6393, 124.4317), image = 'Morningwood.PNG', customspawn = true } }

Important Notes:

  • Set customspawn = true for apartment spawns
  • name must match apartment identifiers in qb-apartments
  • These only appear when player doesn't own an apartment

CUSTOM SPAWN HANDLERS#

DoCustomSpawn Function#

For advanced spawn logic, use the DoCustomSpawn() function:

config/config.lua
function DoCustomSpawn(data) local IndexName = data.name -- QB Apartments if IndexName == "apartment1" or IndexName == "apartment2" then DoScreenFadeOut(50) Wait(200) TriggerServerEvent("apartments:server:CreateApartment", IndexName, data.label, true) Wait(2000) DoScreenFadeIn(100) -- Your custom spawn logic elseif IndexName == "customlocation" then -- Custom implementation here -- Example: Trigger events, set player data, etc. end end

Parameters:

  • data.name - Spawn location identifier
  • data.label - Display name
  • data.spawn - Spawn coordinates (vector4)
  • data.coords - Camera coordinates
  • data.rot - Camera rotation

When to use:

  • Integrating with housing scripts
  • Custom spawn animations
  • Server-side spawn verification
  • Special spawn conditions

Only locations with customspawn = true will trigger this function!

EXAMPLE CONFIGURATIONS#

Basic Server Setup#

config/config.lua
Config.EnableJailCheck = true Config.EnableLastLocation = true Settings.Locations = { FirstTitle = 'CHOOSE YOUR SPAWN', SecondTitle = "LET'S BEGIN", { name = 'city', label = 'City Center', coords = vector3(215.6, -809.2, 30.7), rot = vector3(0, 0, 180), spawn = vector4(220.5, -810.1, 30.7, 90.0), image = 'city.webp' }, { name = 'beach', label = 'Beach', coords = vector3(-1873.4, -1258.1, 13.4), rot = vector3(0, 0, -37.4), spawn = vector4(-1850.4, -1232.8, 13.0, 321.2), image = 'beach.webp' } }

Roleplay Server with Job Restrictions#

config/config.lua
Settings.Locations = { FirstTitle = 'SELECT SPAWN LOCATION', SecondTitle = 'WHERE WOULD YOU LIKE TO BEGIN?', -- Public spawns { name = 'legion', label = 'Legion Square', coords = vector3(215.6, -809.2, 30.7), rot = vector3(0, 0, 180), spawn = vector4(220.5, -810.1, 30.7, 90.0), image = 'legion.webp' }, -- Police only { name = 'mrpd', label = 'Mission Row PD', coords = vector3(440.5, -981.2, 30.6), rot = vector3(0, 0, 90), spawn = vector4(442.1, -982.0, 30.6, 180.0), image = 'mrpd.webp', job = {'police'} }, -- EMS only { name = 'hospital', label = 'Pillbox Medical', coords = vector3(338.8, -583.9, 43.2), rot = vector3(0, 0, 180), spawn = vector4(341.2, -581.5, 43.2, 270.0), image = 'hospital.webp', job = {'ambulance', 'doctor'} } }

CONFIGURATION TIPS#

✅ Best Practices
  • • Use WebP format for images (smaller file size)
  • • Keep spawn locations under 10 for better UX
  • • Test camera angles in-game before finalizing
  • • Use descriptive names and labels
  • • Enable last location for better player experience
❌ Common Mistakes
  • • Duplicate spawn names (must be unique)
  • • Missing images in web/assets/
  • • Camera too far from spawn point
  • • Spawn heading not set correctly
  • • Job names don't match framework

🔧 NEED HELP? — Join our Discord for configuration assistance and examples from other servers!