Frameworks
What ox_core is and how scripts use it
An overview of ox_core, Overextended's FiveM framework: its TypeScript codebase and Lua/JS APIs, users and characters, OxPlayer, groups, bank accounts with addBalance and transferBalance, persistent vehicles, the ox stack, and when to choose it over ESX, QBCore or Qbox.
Overview
ox_core is the framework from Overextended, the team behind ox_lib, ox_inventory, ox_target and oxmysql. It is written in TypeScript, keeps the core small, and leaves inventory, targeting and UI to the other ox resources. It is less common than ESX or QBCore, but popular with developers who want a clean, typed base.
Core concepts
| Concept | What it is |
|---|---|
| User | The person (identified by their identifiers), with a userId |
| Character | A playable character with a charId |
| Group | Jobs, gangs and other organisations with grades |
| Account | Bank accounts for characters and groups, with roles and permissions |
| Vehicle | Owned, persistent vehicles with a VIN |
Using ox_core from Lua
local Ox = require '@ox_core.lib.init'
RegisterCommand('payday', function(source)
local player = Ox.GetPlayer(source)
if not player or not player.charId then return end
local account = Ox.GetCharacterAccount(player.charId)
if account then
account.addBalance({ amount = 500, message = 'Payday' })
end
end, false)The require form needs lua54 'yes' and ox_lib (which provides require for resource paths). OxPlayer methods such as getGroup(filter) check group membership and grade.
Accounts
| Method | Does |
|---|---|
addBalance({ amount, message }) | Adds money |
removeBalance({ amount, overdraw, message }) | Removes money |
transferBalance({ toId, amount, ... }) | Moves money between accounts |
depositMoney / withdrawMoney | Moves cash (inventory money) in and out |
createInvoice(data) | Bills another account |
JavaScript and TypeScript
Because the core is TypeScript, JS resources are first-class: install @overextended/ox_core from npm and import its functions with full types. See TypeScript scripts.
When to choose ox_core
- You are building a server mostly from your own scripts and want a small, typed core.
- Your team writes TypeScript.
- You accept a smaller catalogue of ready-made resources than ESX or QBCore/Qbox offer.
Framework comparisons for beginners are in ESX vs QBCore vs Qbox.
Frequently asked questions
What is ox_core?
Overextended’s FiveM framework, written in TypeScript, managing users, characters, groups, accounts and vehicles.
How do I use ox_core in Lua?
local Ox = require '@ox_core.lib.init' with ox_lib started and lua54 'yes' in the manifest.
Does ox_core have its own inventory?
No. It uses ox_inventory for items and cash.
Is ox_core better than Qbox?
Neither is better in general. ox_core is smaller and typed; Qbox has a larger ecosystem through QBCore compatibility.
Need this built, not just explained?
Ten years of FiveM work, from Lua to NUI
Custom resources, React NUI, ESX / QBCore / Qbox integration, OneSync performance audits and security reviews — plus the websites and SEO around your server brand.
Related guides
- FrameworksWriting scripts for Qbox (qbx_core)On the server call qbx_core exports: exports.qbx_core:GetPlayer(source), AddMoney(source, 'cash', amount, reason), SetJob(source, job, grade), HasGroup(source, filter) and Notify(source, text, type). On the client, add '@qbx_core/modules/playerdata.lua' to get QBX.PlayerData, kept in sync automatically. Items and inventories go through ox_inventory; UI through ox_lib. A bridge keeps most QBCore scripts working.
- FrameworksGetting started with ox_libStart ox_lib before your resource, add shared_script '@ox_lib/init.lua' and lua54 'yes' to your fxmanifest, and the global lib becomes available. Use cache.ped/cache.vehicle instead of calling natives in loops, lib.callback for client↔server requests, lib.notify, lib.progressBar, lib.registerContext/lib.showContext, lib.inputDialog, lib.points and lib.zones for interaction, and lib.addCommand for commands with ACE restrictions.
- EngineeringWriting FiveM resources in TypeScriptInstall @citizenfx/client, @citizenfx/server, TypeScript and esbuild. Write src/client and src/server, bundle each into a single file (dist/client.js, dist/server.js), and list those in the fxmanifest. Client JS has the ES2017 standard library but no browser or Node APIs; server JS runs on Node.js 16 by default, or Node 22 with node_version '22' in the manifest. Type other resources’ exports by extending CitizenExports.
- FrameworksSupporting several frameworks with a bridgeDetect the running framework with GetResourceState('qbx_core'), ('qb-core') and ('es_extended'), load a matching bridge file, and have every bridge expose the same functions — get player identifier, job, money add/remove, notify, item add/remove. Keep framework calls out of your main logic, allow a config override, and test on each framework you claim to support.