fxmanifest shared_script vs shared_scripts (2026): Correct Syntax and Examples
Many FiveM errors come from one tiny manifest typo: using the wrong shared declaration or wrong data type.
Quick answer
shared_scriptis for one script.shared_scriptsis for multiple scripts.
Both are valid. The key is passing the right value shape.
Correct examples
Single file
fx_version 'cerulean'
game 'gta5'
shared_script 'config.lua'
Multiple files
fx_version 'cerulean'
game 'gta5'
shared_scripts {
'config.lua',
'locales/en.lua',
'shared/utils.lua'
}
Common failure patterns
Wrong type for plural key
-- Wrong
shared_scripts 'config.lua'
Some resources parse this loosely, others fail in weird ways. Use a table for plural.
Wrong load order
If shared/utils.lua defines a helper used by client/main.lua, load shared/utils.lua first.
shared_scripts {
'shared/utils.lua',
'config.lua'
}
client_scripts {
'client/main.lua'
}
Mixing deprecated manifest patterns
Use fxmanifest.lua with modern declarations. If you still ship old styles from legacy resources, standardize to avoid startup surprises.
Debug checklist for nil globals or missing exports
- Confirm file path and case sensitivity.
- Confirm script appears in server console resource load output.
- Check load order in manifest.
- Restart resource after edits:
ensure your_resource. - Look for syntax errors inside shared files.
Practical advice for bigger RP stacks
- Keep shared code minimal and deterministic.
- Move heavy logic to server side.
- Avoid side effects in shared files at import time.
- Add one shared
versionconstant for quick compatibility checks.
If you are cleaning old resources, pair this with our fxmanifest resource guide and FiveM server setup guide.
Final recommendation
Use shared_script for one file and shared_scripts { ... } for many files. Keep load order explicit. Most "random" runtime errors around manifests are not random at all, they are manifest structure issues.
