Nil value (global 'Config')

i have this error in F8 :

SCRIPT ERROR: @ff/client/main.lua:45: attemt to index a nil value (global 'Config')

Line/45 :

if IsPlayerInside(coords, Config.Coords, 20) then

Config.lua file :

Config = {}

-- Coords

Config.Coords		= vector3(182.8,-898.49,30.6)
Config.CarSCoords		= vector3(174.0, -913.0, 30.40)
Config.CarCoords		= vector3(162.61, -881.0, 29.40)

1 Like

try it

Config = {}

– Coords

Config.Coords = vector3(182.8,-898.49,30.6),
Config.CarSCoords = vector3(174.0, -913.0, 30.40),
Config.CarCoords = vector3(162.61, -881.0, 29.40),

Make sure config is starting first in your resource lua or fxmanifest

Sorry but fivem native IsPlayerInside does not work for me!
Same issue for the Config value , use GetDistanceBetweenCoords

That’s not even… a FiveM native?

and … no don’t that’s super slow

Thats not a fivem native, i defined that function

And i forgot to put start config.lua in client_scripts and server_scripts in fxmanifest.lua

1 Like

Did it worked?

Yes

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

server_scripts {
   'server/main.lua',
   'config.lua'
}