Most FiveM script problems are not bugs in the script — they're installation mistakes: wrong folder name, missing dependency, or the wrong load order in server.cfg. This guide shows you how to install FiveM scripts without errors on ESX, QBCore and Qbox.

Step 1 — Upload the resource

Download the script, extract it, and upload the resource folder into your server's resources/ directory (you can group resources into bracketed folders like [scripts] for organization). Make sure the folder name has no spaces and matches what the documentation expects.

Step 2 — Understand fxmanifest.lua

Every resource needs an fxmanifest.lua (older ones use __resource.lua). It tells FiveM which files run on the client, server and shared. If this file is missing, the resource will never load. A typical ESX resource manifest looks like this:

fx_version 'cerulean'
game 'gta5'

author 'W-Development'
description 'Example ESX resource'
version '1.0.0'

shared_scripts {
  '@es_extended/imports.lua',
  'config.lua'
}

client_scripts { 'client/*.lua' }

server_scripts {
  '@oxmysql/lib/MySQL.lua',
  'server/*.lua'
}

dependencies { 'es_extended', 'oxmysql' }

Step 3 — Add it to server.cfg with ensure

Add the resource to server.cfg using ensure. Load order is critical: dependencies must come first.

ensure oxmysql
ensure es_extended
ensure my_new_script   # depends on es_extended -> must be AFTER it

Step 4 — Import the SQL

Many scripts need database tables. Import the included .sql file into your MySQL/MariaDB database (via HeidiSQL, phpMyAdmin or the command line) and make sure your oxmysql connection string in server.cfg is correct:

set mysql_connection_string "mysql://user:password@localhost/database?charset=utf8mb4"

Step 5 — Restart and check the console

Restart the server (or run ensure <resource> from the console) and read the output. Errors almost always point to the exact problem — a missing dependency, a bad path in fxmanifest, or a SQL table that wasn't imported.

Common errors and fixes

  • 'Failed to load resource' — the folder name has a space, or fxmanifest.lua is missing.
  • 'attempt to index a nil value (ESX/QBCore)' — the framework loaded after the script; fix the ensure order.
  • 'No such export' — a dependency like ox_lib or oxmysql isn't started before the script.
  • Nothing happens in-game — the SQL wasn't imported, or the resource isn't ensured in server.cfg.