I'm new to scripting and need help

Hey, i’m new to Fivem scripting and i need help with some lua code and i don’t know how to fix the error in the code.
here is the code
(its a custom config)

Config.ImpoundLots= {
	LSAirport= {
			Pos = {x=-1066.402, y= -2898.891, z= 40.22},
			Size  = {x = 10.0, y = 10.0, z = 1.0},
			Color = {r=0,g=255,b=0}, 
			Marker = 1,
			Type = "helipad",
			Type = "smallhanger",
    AllowedVehicles = {
			Volatus,
			Swift2,
			Swift,
			supervolito2,
			Buzzard2,
			Vestra,
			Velum2,
			Shamal,
			Nimbus,
			Luxor2,
			Cuban800
		},
	RetrievePoint = {
			Pos = {x=-1066.402, y= -2898.891, z= 40.22},
			Heading = 185.0,
			Color = {r=0,g=255,b=0},
			Size  = {x = 10.0, y = 10.0, z = 1.0},
			Marker = 1
		},
	DropoffPoint = {
			Pos = {x=-1058.813, y= -2950.481, z= 40.22},
			Color = {r=0,g=255,b=0},
			Size  = {x = 10.0, y = 10.0, z = 1.0},
			Marker = 1
		},
	},
}

the error is

Error loading script config.lua in resource esx_impound: config.lua:36: attempt to index a nil value (global 'Config')
stack traceback:
        config.lua:36: in main chunk

have you added the file config.lua to fxmanifest?

resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'

version '1.3.0'

client_scripts {
  'config.lua',
  'client/main.lua'
}

server_scripts {
  '@mysql-async/lib/MySQL.lua',
  'config.lua',
  'server/main.lua'
}

this is the fxmanifest

oh add this on line 1
Config = {}

thank you its working

1 Like