So im making a script
and get this error
[ 5835672] [b2699_GTAProce] MainThrd/ Creating script environments for Better%20Jail
[ 5835672] [b2699_GTAProce] MainThrd/ Started resource Better%20Jail
[ 5835672] [b2699_GTAProce] MainThrd/
[ 5835687] [b2699_GTAProce] MainThrd/ OnConnectionProgress: Downloading content manifest…
[ 5836172] [b2699_GTAProce] UV loop: httpClient/ Required resources: Better%20Jail
[ 5836172] [b2699_GTAProce] MainThrd/ OnConnectionProgress: Loading content manifest…
[ 5836203] [b2699_GTAProce] MainThrd/ Creating script environments for Better%20Jail
[ 5836219] [b2699_GTAProce] MainThrd/ OnConnectionProgress: Mounted Better%20Jail (1 of 1)
[ 5836219] [b2699_GTAProce] MainThrd/
[ 5836219] [b2699_GTAProce] MainThrd/ _____ _ _____ _ _______
[ 5836219] [b2699_GTAProce] MainThrd/ / | | | / | | | |
[ 5836219] [b2699_GTAProce] MainThrd/ | | __ _ __ __ _ _ | | | | | | __ _ ___ | | ___ __
[ 5836219] [b2699_GTAProce] MainThrd/ | | | | '/ | '__| __| | | | |/ _
| / | |/ _ \ / _
[ 5836219] [b2699_GTAProce] MainThrd/ | |__| | | | (| | | | | | || | (| |/ /| | | () | /
[ 5836219] [b2699_GTAProce] MainThrd/ _|| _,|| _| _||_,/| ||_/ _|
[ 5836219] [b2699_GTAProce] MainThrd/
[ 5836219] [b2699_GTAProce] MainThrd/ Better Jail V1
[ 5836219] [b2699_GTAProce] MainThrd/
[ 5842187] [b2699_GTAProce] MainThrd/ ^1SCRIPT ERROR: @Better%20Jail/server.lua:17: attempt to index a nil value (upvalue ‘Config’)^7
[ 5842187] [b2699_GTAProce] MainThrd/ ^3> ref^7 (^5@Better%20Jail/server.lua^7:13)
[ 5842187] [b2699_GTAProce] MainThrd/
my server.lua (first lines todo with config, i dont want people stealing my script)
– Load Config
local Config = nil
Citizen.CreateThread(function()
Config = require(“config”)
end)
local jailCooldowns = {}
local jailedPlayers = {}
– /jail command handler
RegisterCommand(“jail”, function(source, args)
– Check if the player has the required permission
if not IsPlayerAceAllowed(source, Config.JailPermissions) then
config.lua
print(“Executing config.lua”)
Config = {}
– Jail permissions
Config.JailPermissions = “staff” – Replace with your desired default jail permissions group
– Jail cooldown
Config.JailCooldown = 120 – Replace with your desired default jail cooldown in seconds
– Jail and release locations
Config.JailLocation = vector3(13, 170, 98) – Replace with your desired default jail location coordinates
Config.ReleaseLocation = vector3(-168, 52, 67) – Replace with your desired default release location coordinates
– Minimum and maximum jail time
Config.MinimumJailTimeMonths = 1 – Replace with your desired minimum jail time in months
Config.MaximumJailTimeMonths = 12 – Replace with your desired maximum jail time in months
return Config – Make sure to return the Config table
fxmanifest.lua
fx_version ‘cerulean’
game ‘gta5’
author ‘Your Name’
description ‘Better Jail V1’
version ‘1.0.0’
shared_scripts {
‘config.lua’
}
client_scripts {
‘client.lua’,
}
server_scripts {
‘server.lua’,
}
Please help, iv had this error and CANNOT fix it