Use config.lua to load local variables in script

I would like to use a config.lua file to load local variables in my client.lua file so that users downloading my script can just adjust the config.lua file to adjust the position of the HUD instead of having to fish for the variables in the client.lua file. Currently my folder for the script looks like this:

Inside of my __resource.lua file is this:

-- Manifest
resource_manifest_version '77731fab-63ca-442c-a67b-abc70f28dfa5'

-- Description
description 'Street Label byLowheartrate'

-- scripts to load
client_scripts {
	'config.lua',
	'client.lua'
}

… and inside of my config.lua I simply have:

local x = 1.000
local y = 1.000 

but when trying to use the x or y variable in the client.lua file and restarting the script in my server it gives me an error and does not show the hud at all.

Because the variables are local.
https://www.lua.org/pil/4.2.html

2 Likes