Installing a FiveM script is a five-minute job when it works and an afternoon when it doesn't. The difference is almost never the script itself. It's one of four things: the folder is in the wrong place, the ensure line doesn't match, the script started before something it needs, or the license it's tied to isn't yours.
This guide walks through the install once, properly, and then shows you how to read the console when it fails — because the console always tells you which of the four it is.
Who this is for. Server owners installing their first paid or free script. If you don't have a server yet, start with how to create a FiveM server; if you haven't set up the admin panel, txAdmin comes first.
What a FiveM script actually is
A script is a resource: a folder with an fxmanifest.lua at its root. That file tells FiveM which files are client-side, which are server-side, and which other resources must be running first. Everything else in the folder — Lua, JavaScript, HTML for menus, images, sounds — is loaded according to that manifest.
Two consequences follow:
- The folder name is the resource name.
ensure hz_libstarts the folder calledhz_lib, nothing else. Rename the folder and you rename the resource. - A folder without an
fxmanifest.luaat its root is not a resource. The most common install mistake is a double-nested folder —hz_weather/hz_weather/fxmanifest.lua— straight out of a zip. FiveM sees the outer folder, finds no manifest, and ignores it.
Step 1 — Put the folder in resources/
Your server has a resources folder. On a txAdmin install it lives under the server data folder you chose during setup, typically:
server-data/
└── resources/
├── [cfx-default]/
├── [standalone]/
├── [esx]/ or [qb]/ or [qbx]/
└── [scripts]/ ← yours
The bracketed folders are categories, not resources. FiveM scans them recursively, so resources/[scripts]/hz_cook/fxmanifest.lua is found exactly like resources/hz_cook/fxmanifest.lua. Use them to keep things tidy; never nest one resource inside another.
Unzip the script and check the result with your own eyes:
resources/[scripts]/hz_cook/fxmanifest.lua ✓
resources/[scripts]/hz_cook/hz_cook/fxmanifest.lua ✗ double-nested
resources/[scripts]/hz_cook-main/fxmanifest.lua ✗ wrong name (GitHub zip)
A zip downloaded from GitHub adds -main or -master to the folder name. Rename it to what the documentation says the resource is called.
Step 2 — Add the ensure line to server.cfg
server.cfg is the list of what your server starts, in order. Add one line per script:
ensure hz_cook
ensure starts the resource and restarts it if it stops; it's what you want for anything permanent. start exists too and only starts once — you'll see it in old tutorials, ensure replaced it.
The name after ensure must match the folder name exactly. Linux servers are case-sensitive: ensure HZ_Cook will not find hz_cook.
Step 3 — Start it in the right order
This is the step that breaks most installs, and the console won't always make it obvious.
Resources start in the order they appear in server.cfg. A script that depends on something — the framework, a database wrapper, a shared library — must come after it:
# 1. Database and framework
ensure oxmysql
ensure qb-core # or es_extended, or qbx_core
# 2. Shared libraries other scripts call
ensure ox_lib
ensure hz_lib
# 3. Everything that uses the above
ensure ox_inventory
ensure ox_target
ensure hz_weather
ensure hz_cook
The documentation of a script tells you what it needs. HZ scripts, for instance, all plug into hz_lib, which itself must start after the framework it detects but before any script that uses it — its console line [HZ Bridge] … Framework: qbcore | Inventory: ox_inventory … is how you confirm the order is right.
A dependency declared in fxmanifest.lua (dependency 'ox_lib') makes FiveM refuse to start the script if the dependency isn't running. A dependency that is only used but not declared fails later, at runtime, with a nil value error deep in a file you didn't write. Both are the same problem: start order.
Step 4 — Load it without restarting the server
You don't need a full restart to add a script. In the txAdmin console (or the server console):
refresh
ensure hz_cook
refresh re-scans the resources folder so FiveM sees the new folder; ensure then starts it. Watch the console for the resource's own startup message — most scripts print one — and for anything red.
A full server restart is only needed when a script changes the database schema (a .sql file to run once) or touches the framework's core files.
Step 5 — Do the one-time setup the script asks for
Read the installation page of the script's documentation. Depending on the script, "installed" can also mean:
- Running an SQL file in your database — items, tables, columns. Usually once, before the first start.
- Adding items to your inventory's item list (
ox_inventory/data/items.lua,qb-core/shared/items.lua, …) and copying their images into the inventory's image folder — not into the script's folder. The script can't write to another resource for you. - Editing
config.lua— the only file you're meant to open. Everything the author expects you to change is there; if you find yourself editing anything else, stop and check the docs. - Granting permissions — an
add_aceline inserver.cfgfor admin features, or a Discord role.
Escrow and Keymaster: why a paid script "doesn't run"
Most paid FiveM scripts are escrowed: part of the code is encrypted by Cfx.re and only executes on servers whose license key belongs to the Cfx.re account that bought it. You manage this on Keymaster, the same place your server's license key comes from.
What you should know before installing one:
- The purchase is tied to a Cfx.re account, not to a server. The script runs on any server whose license key was generated by that account. Buying on one account and running on a server licensed by another is the number-one cause of "the script I paid for won't start".
- Escrow does not hide the config. The
config.luaand, usually, the client-side files are readable. Escrow only covers the core logic. - The error is explicit. An escrowed script that isn't authorised prints an authentication error naming the resource. If you see it, check which account owns the license key in Keymaster; it's an account mismatch, not a bug.
- Transfers exist. Keymaster lets you transfer an asset to another account. Do that rather than sharing the files — sharing is a breach of the licence, and the files won't run anyway.
Reading the console: the four errors that cover 90% of installs
| What the console says | What it means | Fix |
|---|---|---|
Couldn't find resource hz_cook. | The name after ensure doesn't match a folder, or the folder has no fxmanifest.lua at its root | Check the folder name and the double-nesting; refresh after fixing |
Resource hz_cook is missing dependency ox_lib | A dependency isn't started, or starts later in server.cfg | Move the dependency above the script |
attempt to index a nil value (global 'QBCore') (or ESX, exports.ox_lib) | The script started before the framework or library it uses | Start order, or a script built for a different framework |
Error loading script … in resource hz_cook: … authentication | Escrow: the server's license key isn't from the account that bought the script | Check the key's account in Keymaster |
Free vs paid scripts: what changes for the install
Nothing in the steps above. What changes is where the folder comes from and what support you get:
- Free scripts come from GitHub or the Cfx.re forum. Expect to rename the folder, sometimes to fix a deprecated function, and to read issues on the repository when something breaks. That's the price.
- Paid scripts come from a Tebex delivery, are escrowed, and come with a documentation site and a support channel. The install is the same; the difference is that when it fails, someone answers.
ox_inventory will not work with qb-inventory unless it says so; a script for ESX will not run on QBox. Scripts that go through a bridge — HZ scripts use hz_lib to detect ESX, QBCore, QBox or Standalone automatically — sidestep the question, but they're the exception, not the rule.
Checklist
Before you open a ticket anywhere:
fxmanifest.luais at the root of the folder, and the folder name is the one the docs use.ensure <name>is inserver.cfgwith the exact same spelling.- Every dependency the docs list starts above the script.
- The SQL was run once, items were added to the inventory, images copied into the inventory's image folder.
- For a paid script: the server's license key belongs to the buying Cfx.re account.
- The console shows the script's own startup line, and no red line names it.
FAQ
Where do I put a FiveM script? In your server'sresources folder, as its own folder with an fxmanifest.lua at the root. Bracketed folders like [scripts] are categories and are scanned recursively.
Why does my script say "Couldn't find resource"?
The ensure name doesn't match the folder exactly, or the folder is double-nested from the zip. Fix, then refresh and ensure again.
Do I have to restart the whole server to add a script?
No — refresh then ensure scriptname in the console. A full restart is only for SQL changes or framework-core changes.
What does escrow mean?
Part of the code only runs on servers licensed by the Cfx.re account that bought the script, via Keymaster. Config and usually client files stay readable.
In what order should scripts start?
Framework → shared libraries (oxmysql, ox_lib, hz_lib) → everything that depends on them.
Can I install ESX scripts on a QBCore server?
Not directly. Use a version built for your framework, or a script that detects the framework through a bridge.