How to Add FiveM Resources and Fix Common Script Errors
A FiveM resource is a folder under resources/ with an fxmanifest.lua at its root. To add one, upload the folder, add ensure folder-name to server.cfg below anything it depends on, run refresh in the console, then ensure it. If it fails, the txAdmin console usually names the resource and the reason.
This guide covers the manifest fields you will actually use, how load order works, and what the most common console messages mean. Messages and commands here come from FiveM's documentation and server source; third-party errors are marked as such.
- Every resource needs
fxmanifest.luadirectly in its folder. A nested folder after unzipping is the most common reason a resource is not found. - Folder name must match the name in your
ensureline exactly. - Put dependencies (database layer, framework core) above the resources that use them.
- After adding files while the server runs, run
refresh, thenensure resourcename. - For "server thread hitch warning" lines, find the slow resource with
profiler record 500andprofiler viewin the server console.
On this page
How resources are organised
Resources load from the resources/ folder in your server data directory. Any folder there is treated as a resource, except folders in square brackets, which are categories that can hold many resources. Category names are for organisation only; you can ensure [category] to start everything inside.
resources/
[framework]/
my-framework-core/
fxmanifest.lua
[scripts]/
my-script/
fxmanifest.lua
client.lua
server.luaFolder names are free-form, but they are what you type after ensure. Files named the old __resource.lua still load with a deprecation warning, but new resources should use fxmanifest.lua.
fxmanifest.lua basics
The manifest is always Lua and tells the server which files to load. A minimal one looks like this:
fx_version 'cerulean'
game 'gta5'
author 'Your Name'
description 'What this resource does'
version '1.0.0'
shared_script 'config.lua'
client_scripts {
'client/*.lua'
}
server_scripts {
'server/*.lua'
}
dependencies {
'oxmysql'
}| Field | What it does |
|---|---|
fx_version | Selects the manifest version. The docs list cerulean as the current one. A missing value triggers a console warning and the resource is not allowed to load. |
game / games | Which game the resource supports: gta5, rdr3 or common. A resource that does not support the current game is skipped with a warning. |
client_script(s), server_script(s), shared_script(s) | Scripts to load on the client, server, or both. Globs such as *.lua and **/*.lua are supported. |
files and ui_page | Extra files that clients need, such as an HTML interface. Files referenced by ui_page must also be listed. |
dependency / dependencies | Requires the named resource to load before this one. It can also hold runtime constraints such as /onesync. |
provide | Declares that the resource can stand in for another, such as a drop-in replacement for a database library. |
server_only 'yes' | Stops clients from downloading the resource. |
Step-by-step: add a resource
- Read the resource's page
Look for dependencies, a required framework, SQL to import, and any config values to edit.
- Upload the folder
Place it under
resources/, in a category folder if you like, using SFTP or your host's file manager.resources/[scripts]/my-script/fxmanifest.lua - Check the folder is not nested
Open the resource folder and confirm
fxmanifest.luais directly inside. Archives often unzip tomy-script/my-script/. - Import any SQL
If the resource ships a
.sqlfile, import it into the database before starting. - Add it to server.cfg
Add
ensure my-scriptbelow the lines for anything it depends on.ensure my-script - Load it live
In the console run
refresh, thenensure my-script. Watch the output for errors. - Test as a player
Join and test the feature. Keep the console open while you do.
Hosting with ChicagoServers? The GTA V FiveM server hosting page lists what is included, such as free server backups and SFTP file access.
Dependency order
The manifest's dependencies field says a resource needs another to load before it. The documentation does not promise that it will start missing dependencies for you, so do not rely on that. Instead, list dependencies explicitly above the resources that use them in server.cfg, and keep your order consistent:
- Database layer and libraries
- Framework core
- Framework add-ons and job scripts
- Standalone scripts and UI
- Your own scripts
If a script calls an export from a resource that has not started yet, you will usually see a runtime error that names the missing export. The fix is almost always to move the dependency's ensure line higher. Also remember that restarting a dependency at runtime can stop the resources that depend on it without restarting them again, so restart the dependents too.
Reading the txAdmin console
txAdmin's Live Console shows the server output with a log file, command history and search. Search for the resource name first. The following messages come directly from FiveM's source or documentation:
| Message | What it means | What to do |
|---|---|---|
Couldn't find resource X. | No loaded resource has that name. Either the folder name differs from what you typed, the folder is nested, or the server has not refreshed. | Check the spelling and the folder level, run refresh, and try again. |
Resource loading for X failed: (followed by a reason) | The manifest could not be loaded, often a syntax error in fxmanifest.lua. | Read the reason line. Fix the Lua syntax in the manifest. |
Couldn't start resource X. | The resource exists but failed to start. | Scroll up for the error that came before it. |
X does not have a resource manifest (fxmanifest.lua) | The manifest is missing or misnamed. On Linux the filename is case sensitive. | Move or rename the file. |
Resource X does not specify an `fx_version` in fxmanifest.lua. | The manifest has no fx_version. | Add fx_version 'cerulean'. |
Resource X does not support the current game | The game line does not include the game your server runs. | Fix the game or games line. |
SCRIPT ERROR: with a stack trace | A running script threw an error. Skip any internal citizen:/scripting/ lines and find the first line in your resource. | Open the named file and line. |
Community guides also report "No such export" errors when a resource calls another that is not running or started later, and "attempt to index a nil value" for something that has not initialised yet. Both usually point back to start order.
Hitch warnings and performance
A "server thread hitch warning" line, shown as server thread hitch warning: timer interval of ... milliseconds, means the server thread was blocked longer than it should be. Community guides attribute most hitches to a resource looping over all players, slow database queries, or events sent too often. An isolated one at startup is normal; repeated ones under load are worth chasing.
FiveM's own profiler finds the culprit. Run these in the server console:
profiler record 500
profiler status
profiler view
profiler saveJSON profile.jsonprofiler record 500captures 500 frames. Trigger the lag while it records.profiler statusshows whether the capture has finished.profiler viewopens the capture in Chrome. When run on the server, it gives you a link to copy into Chrome.profiler saveJSON profile.jsonsaves it for later. In Chrome DevTools, use the Performance tab and load the profile. The yellow resource tick events show time per resource, with file and line numbers.
Fixes follow the finding: update or replace the resource, reduce its loops, timers or events, or disable it to confirm it is the cause.
When the server is up but players cannot find or join it
- Check
sv_master1is commented out. If the line is present uncommented, the server shows as private and the browser's connect button is disabled. - Test
http://your-ip:30120/info.jsonin a browser, and tryconnect ip:portfrom the F8 console in FiveM. - A new server can take up to about 8 minutes to appear in the server list.
- Slow startup on a self-run Windows machine is often Microsoft Defender scanning FXServer files. FiveM's docs suggest adding an exclusion for the server folder.
Frequently asked questions
Why does FiveM say it can't find my resource?
The name in your ensure line must match the folder name exactly, and fxmanifest.lua must be directly inside that folder. Archives often unzip into a nested folder. After fixing it, run refresh and ensure the resource again.
What does fxmanifest.lua need at minimum?
An fx_version (cerulean is the current one in the docs), a game line such as game 'gta5', and the scripts to load, for example client_script and server_script entries.
What is a server thread hitch warning in FiveM?
It means the server thread was blocked for longer than it should have been, usually by a resource doing heavy work. Use profiler record 500 and profiler view in the server console to see which resource is responsible.
Do I need to restart the server after adding a resource?
Not always. Run refresh in the console so the server rescans the resources folder, then ensure the resource. Add its ensure line to server.cfg so it also starts on the next boot.