Install a script on ESX
Start order, database items, jobs and common pitfalls when you install an RPScripts script on an ESX (es_extended) FiveM server.
This page adds the ESX-specific steps to the general installation. Background on the framework: ESX framework guide.
Requirements
- The product page shows the ESX badge. Check the description for the ESX version: most current scripts target ESX Legacy.
es_extendedandoxmysqlrun on your server. Install any other dependencies from the product description.
oxmysql provides compatibility with many mysql-async and ghmattimysql calls, but not every old resource
works unchanged. Check the resource's manifest and database calls against the
oxmysql compatibility guide.
If changes are needed, see Migrate mysql-async resources to oxmysql.
Start order
ensure oxmysql
ensure es_extended
ensure resource_nameAdd the items
In ESX, items live in the database table items. Scripts usually ship them in their .sql file:
INSERT INTO `items` (`name`, `label`, `weight`) VALUES
('example_item', 'Example Item', 1);Import the file into your server database, then restart the server. On a duplicate entry error, compare the existing row with the supplied definition before deciding what to skip. One statement may contain several items, so skipping it can leave other items missing. Database precautions.
If your ESX server uses ox_inventory, items are defined in ox_inventory/data/items.lua instead.
Add jobs
Jobs are stored in the jobs and job_grades tables. Job scripts include the rows in their SQL; the job name must match the script's config.
Common ESX problems
| Symptom | Likely cause |
|---|---|
attempt to index a nil value (global 'ESX') | The script starts before es_extended, or it uses the old esx:getSharedObject event on a server that no longer provides it. Check the start order first. |
Table '...' doesn't exist | The script's SQL file was not imported into the database your server uses. |
| Item does not exist in game | The item is missing from the items table or its name differs from the config. |
Install a script on QBCore
Start order, shared items, jobs and common pitfalls when you install an RPScripts script on a QBCore FiveM server.
Install a script on Qbox
Start order, ox_inventory items, the QBCore bridge and common pitfalls when you install an RPScripts script on a Qbox (qbx_core) FiveM server.