An experimental framework for FiveM. Limited support and breaking changes guaranteed.
This resource does not have a stable (v1.0) release; breaking changes are likely.
Documentation may not be kept updated in some cases.
Installation
We strongly recommend referring to Guides for setting up Git, Node.js, and pnpm.
Install all resource dependencies.
Download a release (opens in a new tab) or build the source code.
git clone https://github.com/overextended/ox_core.git
cd ox_core/web
pnpm i
pnpm build
Install optional dependencies.
These resources aren't required but provide additional functionality.
(Optional) Configure pefcl
If using it with ox_inventory, open pefcl/config.json
and enable framework integration.
"frameworkIntegration": {
"enabled": true,
"resource": "ox_inventory",
"syncInitialBankBalance": false
},
Importing into resources
Lua
Lua imports can be defined as part of fxmanifest, or loaded with the load function.
client_scripts {
'@ox_core/imports/client.lua',
'client/main.lua',
}
server_scripts {
'@oxmysql/lib/MySQL.lua',
'@ox_core/imports/server.lua',
'server/main.lua',
}
JavaScript
To use ox_core with your JS/TS resources you'll need to use our npm package, allowing you to import core functions with full type and intellisense support.
Config
Resource configuration is handled using convars (opens in a new tab).
# Players must have a valid identifier to join the server. Used to fetch userid from the database.
set ox:primaryIdentifier "fivem"
# Set the number of active characters a user can have registered.
setr ox:characterSlots 5
# Enables debug and development features. Should only be used in a development environment.
setr ox:debug 0
# Disable death system handle by core.
setr ox:deathSystem 0
# Disable the spawn selection.
setr ox:spawnSelect 0