Resources & manifest
How Lua resources are laid out, what goes in the manifest and how a resource starts and stops.
Your server is scripted in Lua 5.4 with resources. A resource is a folder in resources/. Each resource runs in its own Lua state, so global variables are not shared between resources - use events for that.
The server package comes with example resources you can learn from.
#Folder layout
server/
├─ server.cfg
└─ resources/
├─ basics/
├─ chat/
└─ economy/
├─ resource.lua <- manifest (fxmanifest.lua works too)
├─ config.lua
├─ server.lua
└─ data/#The manifest
Every resource has a manifest: resource.lua or fxmanifest.lua.
name 'economy'
description 'Gold and bank'
author 'You'
version '1.0.0'
shared_script 'config.lua' -- or shared_scripts { ... }
server_scripts { 'server.lua', 'bank.lua' } -- or server_script '...'| Function | What it does |
|---|---|
name, description, author, version | Metadata. |
shared_script / shared_scripts | Run first, on the server. |
server_script / server_scripts | Run after the shared scripts. |
fx_version, game, lua54 | Accepted (FiveM-compatible). |
client_script(s), dependency / dependencies | Accepted, but ignored in 2.x. |
#Start a resource
Add an ensure line to server.cfg with the folder name. Resources start in the order they are written:
ensure basics
ensure chat
ensure economyYou can also start and stop resources while the server runs, with res.start, res.stop and res.restart in the server console.
#Lifecycle
- The server reads
server.cfgand starts eachensureresource in order. - The manifest is read and the scripts run: first shared, then server.
- The event
onResourceStart(name)is sent to all resources. - On
res.stop,res.restartor shutdown,onResourceStop(name)is sent, and the resource's Lua state is closed. Its event handlers, threads and commands are removed.
In version 2.x scripts only run on the server. The client reacts in Blueprint - see Blueprint & C++ API.
Copy one of the example resources in the package, rename the folder and start from there.
Last updated 2026-12-06