GamesLauncherNewsDocsCommunityMy accountMy serversDownload Launcher
DocsLua scripting

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

text
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.

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 '...'
FunctionWhat it does
name, description, author, versionMetadata.
shared_script / shared_scriptsRun first, on the server.
server_script / server_scriptsRun after the shared scripts.
fx_version, game, lua54Accepted (FiveM-compatible).
client_script(s), dependency / dependenciesAccepted, 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:

cfg
ensure basics
ensure chat
ensure economy

You can also start and stop resources while the server runs, with res.start, res.stop and res.restart in the server console.

#Lifecycle

  1. The server reads server.cfg and starts each ensure resource in order.
  2. The manifest is read and the scripts run: first shared, then server.
  3. The event onResourceStart(name) is sent to all resources.
  4. On res.stop, res.restart or shutdown, onResourceStop(name) is sent, and the resource's Lua state is closed. Its event handlers, threads and commands are removed.
Note

In version 2.x scripts only run on the server. The client reacts in Blueprint - see Blueprint & C++ API.

Tip

Copy one of the example resources in the package, rename the folder and start from there.

Last updated 2026-12-06