
Quick answer: In 2026, a normal FiveM resource should use fxmanifest.lua, fx_version 'cerulean', and games . Use client_script for one file, client_scripts for a list, and dependencies only for resources that must start before yours.
Copy-paste fxmanifest.lua template
fx_version 'cerulean'
games { 'gta5' }
author 'Your Name'
description 'My FiveM resource'
version '1.0.0'
shared_scripts {
'config.lua',
'@ox_lib/init.lua'
}
client_scripts {
'client/*.lua'
}
server_scripts {
'@oxmysql/lib/MySQL.lua',
'server/*.lua'
}
files {
'html/index.html',
'html/style.css',
'html/app.js',
'html/assets/*.png'
}
ui_page 'html/index.html'
dependencies {
'ox_lib',
'oxmysql'
}
client_script vs client_scripts
| Directive | Use it when | Example |
|---|---|---|
| client_script | One client file | client_script 'client.lua' |
| client_scripts | Multiple client files | client_scripts |
The plural version expands into multiple client_script metadata entries internally. That is why both work. The mistake is mixing table syntax with the singular name.
Correct:
client_scripts {
'client/main.lua',
'client/menu.lua'
}
Also correct:
client_script 'client/main.lua'
Avoid:
client_script {
'client/main.lua',
'client/menu.lua'
}
server_script and shared_script
| Directive | Runs where | Common use |
|---|---|---|
| client_script(s) | Player client | UI, markers, keybinds, client natives |
| server_script(s) | Server | database, permissions, callbacks |
| shared_script(s) | Both | config, locales, item tables |
Load shared scripts before client/server scripts when both sides need config values.
dependencies vs dependency
Use dependency for one hard dependency and dependencies for multiple.
dependency 'ox_lib'
-- or
dependencies {
'ox_lib',
'oxmysql'
}
A hard dependency means your resource should not start until that resource is available. This is correct for frameworks, libraries, database wrappers, and resources whose exports you call on startup.
optional_dependencies in fxmanifest.lua
There is no official base FiveM manifest directive named optional_dependencies in the current Cfx.re resource manifest docs. If you want optional integration, do not make it a hard dependency. Check the resource at runtime instead.
Example optional ox_target support:
local hasOxTarget = GetResourceState('ox_target') == 'started'
if hasOxTarget then
exports.ox_target:addBoxZone({
coords = vec3(0.0, 0.0, 72.0),
size = vec3(1.5, 1.5, 2.0),
options = {
{
label = 'Open menu',
onSelect = function()
print('selected')
end
}
}
})
end
Use dependencies when it is required. Use GetResourceState when it is optional.
files and ui_page for NUI
If your resource has a browser UI, reference every static file the client needs.
files {
'html/index.html',
'html/style.css',
'html/app.js',
'html/fonts/*.woff2',
'html/images/*.png'
}
ui_page 'html/index.html'
If you forget files, the UI page may load but CSS, JS, images, or fonts will 404 on the client.
Globs that work
| Pattern | Meaning |
|---|---|
| *.lua | Lua files in this folder only |
| client/*.lua | Lua files directly inside client |
| client/**/*.lua | Lua files in client and nested folders |
| html/assets/*.png | PNG files directly inside assets |
Prefer explicit folders. Huge recursive globs make debugging load order harder.
lua54 in 2026
Cfx.re docs note that lua54 is deprecated because Lua 5.3 support has been removed and Lua scripts now use Lua 5.4. Old resources may still include this line:
lua54 'yes'
It is no longer the setting that fixes modern Lua compatibility. If an old script tells you to add it, update the resource instead of relying on that flag.
node_version
If your server resource uses JavaScript, the manifest can select Node 22:
node_version '22'
Use this only when your JS resource actually needs newer Node runtime features.
exports and server_exports
exports {
'openMenu',
'closeMenu'
}
server_exports {
'getPlayerData'
}
For modern Lua resources, defining exports inside the script is usually cleaner than relying only on manifest-level exports.
data_file examples
Vehicle, handling, audio, and map resources often need data files:
files {
'data/vehicles.meta',
'data/handling.meta'
}
data_file 'VEHICLE_METADATA_FILE' 'data/vehicles.meta'
data_file 'HANDLING_FILE' 'data/handling.meta'
The file must be listed in files and registered with the right data_file type.
Full checklist before restarting a resource
- fx_version is cerulean
- games includes gta5
- client scripts are client-side only
- server scripts do not call client-only natives
- shared config loads before client/server scripts
- NUI html, css, js, images, and fonts are listed in files
- hard dependencies use dependencies
- optional integrations use runtime GetResourceState checks
- old __resource.lua files are migrated to fxmanifest.lua
