I am attempting to create a script that allows me to have a number of “Key Safes” around the city, but unfortunately I can’t get the ox_target export ‘addBoxZone’ to play ball.
Code:
CreateThread(function()
for _, keySafe in pairs(Config.KeySafes) do
exports.ox_target:addBoxZone(keySafe.name, keySafe.location, 1, 1, {
name = keySafe.name,
heading = 0,
debugPoly = false,
minZ = keySafe.location.z - 1,
maxZ = keySafe.location.z + 1
}, {
options = {
{
label = 'Access Keysafe',
action = function()
currentKeySafe = keySafe
openKeySafeMenu(keySafe)
end,
icon = 'fas fa-key',
distance = 2.0
}
}
})
end
end)
Relevant Errors:
SCRIPT ERROR: @ox_target/client/api.lua:18: expected options to have type 'table' (received nil)
typeError (@ox_target/client/api.lua:18)
checkOptions (@ox_target/client/api.lua:28)
ref (@ox_target/client/api.lua:58)
fn (@vehicleKeySafe/client.lua:9)
SCRIPT ERROR: @vehicleKeySafe/client.lua:9:
An error occurred while calling export `addBoxZone` in resource `ox_target`:
nil
---
Any help would be greatly appreciated!