Ox Core

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.

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.
  • 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.
  • ox:characterSelect
    • Default: true
    • Enables built-in character registration, and uses 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.