So I am new to Fivem and lua development. I am trying to use a variable in my client script that I declared in a config file that I created. Whenever I try to access one of the variables in the client script, I get an error saying it tried to index a nil value.
This is the code in my fx_manifest.lua file:
fx_version ‘cerulean’
game ‘gta5’
client_scripts {
‘client.lua’,
}
shared_scripts {
‘config.lua’
}
This is the code in my config.lua file:
Config = {}
Config.test = 5.0
This is the code in my client.lua file:
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
print(Config.test)
end
end)
This is the exact error that I get in the Fivem console:
All of the files are in the same directory so the file paths in the manifest should not be the problem.