Config is nil
A script tried to read its own settings before they had loaded. It is an ordering mistake inside the script.
Do this first
If you edited its config file, undo that first. Otherwise it needs a small code fix.
What it means
A script read Config before the file that defines it had run. The table is built at load time, and fxmanifest decides the order files load in, so this is almost always an ordering problem rather than a missing file.
What causes it
Ordered by how often it is the answer.
- 1
config.lua is listed after the file that uses it
Files load in the order the manifest lists them, top to bottom, within each section.
- 2
config.lua is only in client_scripts but the server reads it
A config both sides need belongs in
shared_scripts. - 3
The config declares a LOCAL table
local Config = {}is invisible to every other file. It has to be a global, or exported deliberately. - 4
A glob swept the config in at the wrong position
client_scripts { 'client/*.lua' }where config.lua lives inclient/puts it in alphabetical order, not the order you wanted. - 5
Two config files, one overwriting the other
config.luaandconfig_custom.luaboth assigningConfig = {}.
How to tell which one is yours
print('config loaded', Config ~= nil)at the top of the file that fails. Then move config.lua to the top of shared_scripts and see if the message changes.
Where to look
fxmanifest.lua, the order inside shared_scripts and client_scripts.
How to fix it
fx_version 'cerulean'
game 'gta5'
shared_scripts {
'config.lua', -- first, and shared so BOTH sides see it
}
client_scripts { 'client/*.lua' }
server_scripts { 'server/*.lua' }And make it a global:
Config = {} -- not `local Config = {}`Still stuck on your own code?
This page is what this error usually means. Paste your console into Server Fixer and it will rank everything in it and tell you what to do first, and if you would rather not touch it, ORBIE can repair the script and hand the resource back ready to drop in.
bug_reportOpen Server Fixer