fxmanifest shared_script vs shared_scripts (2026): Correct Syntax and Examples

Published on

A practical guide to shared_script versus shared_scripts in FiveM fxmanifest.lua, with correct syntax, load-order tips, and debugging steps for missing exports or nil globals.

Written by Jochem, Infrastructure Engineer at Space-Node, 5-10 years experience in game server hosting, VPS infrastructure, and 24/7 streaming solutions. Read author bio →

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_script is for one script.
  • shared_scripts is 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 version constant 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.

Jochem

About the Author

Jochem, Infrastructure Engineer at Space-Node, expert in game server hosting, VPS infrastructure, and 24/7 streaming solutions with 5-10 years experience.

Since 2023
500+ servers hosted
4.8/5 avg rating

I specialize in Minecraft, FiveM, Rust, and 24/7 streaming infrastructure, operating enterprise-grade AMD Ryzen 9 hardware in Netherlands datacenters.

View my full bio and credentials →

Launch Your VPS Today

Get started with professional VPS hosting powered by enterprise hardware. Instant deployment and 12/7 support included.