Scripts, called resources in FiveM, are what add jobs, menus, economies, and features to your server. Installing them correctly is straightforward once you understand the resource system. Here is how to do it right.
How FiveM Scripts Work
A FiveM script is a folder placed in your server resources directory. The server loads it when you add an ensure line in server.cfg. Scripts can be standalone, or they can depend on a framework like ESX or QBCore.
Step 1: Get the Script
Download the resource from a trusted source such as the official Cfx.re forums or a reputable marketplace. Avoid cracked paid scripts, since they are a common way servers get backdoored.
The download is usually a folder or a zip. If it is zipped, extract it first.
Step 2: Place It in Resources
Move the script folder into your server resources directory. Many owners organize scripts into category subfolders. If you use a subfolder, the path matters for how you reference it.
A clean folder name without spaces or version numbers is easiest to manage, so rename something like script-v1.2 to just the script name.
Step 3: Add the ensure Line
Open server.cfg and add an ensure line so the server starts the resource:
ensure myscript
Order matters when scripts depend on others. Frameworks and libraries must start before the scripts that use them, so list ESX or QBCore and shared libraries first.
Step 4: Install Dependencies
Many scripts need a framework and shared libraries. Read the script documentation and install:
- The framework, such as ESX or QBCore
- Shared libraries the script lists, like ox_lib
- Any database tables the script requires
If a script needs database tables, import the included SQL file into your database before starting.
Step 5: Configure and Restart
Most scripts include a config file where you set options like prices, locations, and permissions. Adjust it to your server, then restart the server or start the resource live.
Common Script Errors
Resource could not be started: Often a missing dependency or a syntax error. Check the console for the exact reason.
Script depends on a framework that is not loaded: Make sure the framework starts before the script in server.cfg.
Database errors: The SQL was not imported, or the connection string is wrong. Import the tables and verify your database settings.
Tips
Add one script at a time and test it before adding the next, so you can isolate problems. Keep a backup of a working server.cfg. Read each script readme fully, since dependencies are the most common cause of failures.
FAQ
Where do FiveM scripts go? In your server resources directory, then add an ensure line in server.cfg.
Why will my script not start? Usually a missing dependency, wrong load order, or a missing database import. Check the server console.
Do I need ESX or QBCore? Only if the script requires it. Standalone scripts run without a framework.
Related: How to install FiveM mods, How to make a FiveM server, FiveM ESX vs QBCore