Ox Core
A modern FiveM framework. 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 to setup necessary development tools.
Install all resource dependencies.
Download the latest release (opens in a new tab) or build the source code.
- Setup Git, Node.js, and pnpm.
- Download and setup MariaDB (opens in a new tab), if you do not already have a database server.
- Run the following commands in your CLI (e.g. Terminal, Command Prompt).
git clone https://github.com/overextended/ox_core.git
cd ox_core
pnpm i
pnpm build
Install optional dependencies.
These resources aren't strictly required, but they are strongly recommended.
Using ox_core in your resources
Lua
You can import ox_core definitions by loading @ox_core/lib/init.lua
into your resource.
Add the import path into your resource's fxmanifest.lua, like any other script file.
This can be a client_script or server_script, if necessary.
shared_script '@ox_core/lib/init.lua'
JavaScript
To use ox_core with your JavaScript resources you'll need to use our npm package, providing full support for TypeScript and Intellisense.
To get started, try our fivem-typescript-boilerplate (opens in a new tab) and install the ox_core package.
pnpm i @overextended/ox_core
Config
Resource configuration is handled using convars (opens in a new tab).
Replicated
These convars should use the setr
command to be read by clients.
ox:debug
- Default:
false
- Enables debug messages and commands. Enabled by default when using
pnpm watch
.
- Default:
ox:characterSlots
- Default:
1
- Sets the number of character slots available for character selection resources (e.g. ox_charselect).
- Default:
ox:plateFormat
- Default:
"........"
- See SET_DEFAULT_VEHICLE_NUMBER_PLATE_TEXT_PATTERN (opens in a new tab).
- Default:
ox:deathSystem
- Default:
true
- Enables the built-in death and respawn system.
- Default:
ox:characterSelect
- Default:
true
- Enables built-in character registration, and uses uses that character when joining.
- Default:
ox:spawnLocation
- Default:
[-258.211, -293.077, 21.6132, 206.0]
- Sets the default spawn location for newly created characters.
- Default: