Skip to content
RPScripts
RPScripts Docs

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_extended and oxmysql run 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

server.cfg
ensure oxmysql
ensure es_extended

ensure resource_name

Add the items

In ESX, items live in the database table items. Scripts usually ship them in their .sql file:

example.sql
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

SymptomLikely 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 existThe script's SQL file was not imported into the database your server uses.
Item does not exist in gameThe item is missing from the items table or its name differs from the config.

More: Startup errors, Fix ESX weight inventory issues.