From the reference libraryFiveM

Ox Core

ox/ox_core/index.mdx

Ox Core

A modern FiveM framework, designed to properly support features like OneSync, statebags, and server-side entities.

txAdmin recipe

If you're looking to quickly install and setup ox_core, try using our recipe.

Installation

We strongly recommend referring to Guides to setup necessary development tools.

Installation > Install all resource dependencies. [step]

Installation > Download a release or build the source code. [step]

git clone https://github.com/overextended/ox_core.git
cd ox_core
bun i
bun run build

Installation > Install optional dependencies. [step]

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.

This can be a client_script or server_script, if preferred.
```lua
shared_script '@ox_core/lib/init.lua'
```




If you prefer, you can use our [require](../ox_lib/Modules/Require/Shared) function from [ox_lib](../ox_lib).
```lua
local Ox = require '@ox_core.lib.init'
```

Using ox_core in your resources > 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 and install the ox_core package.

bun i @overextended/ox_core

Config

Resource configuration is handled using convars.

Config > Replicated

These convars should use the setr command to be read by clients.

  • ox:debug
    • Default: false
    • Enables debug messages and commands. Also allows players to have the same identifiers. Enabled by default when using bun watch.
  • ox:characterSlots
    • Default: 1
    • Sets the number of character slots available for character selection resources (e.g. ox_charselect).
  • ox:plateFormat
  • ox:deathSystem
    • Default: true
    • Enables the built-in death and respawn system. When disabled the isDead player state will still be set to true and the ox:playerDeath event will be triggered.
  • ox:hospitalBlips
    • Default: true
    • Enables the hospital blips used when reviving with the default deathSystem.
  • ox:characterSelect
    • Default: true
    • Enables built-in character registration, and uses that character when joining.
  • ox:spawnLocation
    • Default: [-258.211, -293.077, 21.6132, 206.0]
    • Sets the default spawn location for newly created characters.
  • ox:defaultVehicleStore
    • Default: 'impound'
    • On resource start any vehicles that were previously spawned will be stored here. An empty string will not update the database.
Back to documentation