Skip to content

Config Settings

Config Settings#

Adjust the following settings to fit your server:

text
Config = {}
Config.ServerCallbacks = {}
Config.UseTextUI = true -- Activate this you have frkn-textui-2 script
Config.CommandPermission = 'auto' -- permission level for creating new doors ('auto' detects QB/ESX automatically, or put 'god', 'admin', 'superadmin', etc.)
Config.AdminAccess = false -- Enable admins to unlock any door
Config.AdminPermission = 'auto' -- The permission needed to get AdminAccess if it is enabled ('auto' detects QB/ESX automatically)
Config.Warnings = true -- if true it will show warnings in the console when certain requirements aren't met
Config.EnableSounds = true -- Enable sounds when unlocking/locking doors (doors triggered by scripts can have the sound manually disabled)
Config.EnableAnimation = true -- Enable the animation when unlocking/locking doors (doors triggered by scripts can have the animation manually disabled)
Config.PersistentDoorStates = false -- Persists the door state between server restarts
Config.PersistentSaveInternal = 60000 -- How often door states are saved to the file system, in miliseconds. 
Config.RemoteTriggerDistance = 15.0 -- This is how far from your camera the raycast will go to try to hit something solid
Config.RemoteTriggerMinDistance = 5.0 -- This is the minimum distance required for the raycast hit to count near a door. It will take the larger two between this and 'distance' option
Config.FaceScanner = "qua_scanner" -- Face scanner prop name
Config.ControllerProp = "ch_prop_ch_metal_detector_01a"
Config.TvProp = "prop_tv_flat_michael" -- TV prop name
Config.Interaction = { -- Interaction settings
    Target = "auto", -- 'auto' automatically detects target scripts. Options: 'qb-target', 'ox_target', 'qtarget', 'auto'
}

Config.GetPlayerGang = function(source, CoreName, Core)
    -- This function retrieves the player's gang.
    -- If you are using ESX and have a custom gang system, you can change the ESX section below.
    if CoreName == "qb-core" or CoreName == "qbx_core" then
        local player = Core.Functions.GetPlayer(source)
        if player and player.PlayerData.gang then
            return player.PlayerData.gang.name
        end
    elseif CoreName == "es_extended" then
        local player = Core.GetPlayerFromId(source)
        if player and player.job then
            return player.job.name -- By default, ESX doesn't have gangs, so we fallback to job
        end
        -- For custom ESX gang systems, comment out the lines above and use your gang export here:
        -- Example: return exports['my_gang_system']:GetGang(source)
    end
    return nil
end

Config.Commands = {
    CreateSingleDoor = 'createsingledoor', -- Opens the menu to create a single door
    CreateDoubleDoor = 'createdoubledoor', -- Opens the menu to create a double door
    DoorDebug = 'doordebug', -- Toggles debug mode showing door IDs and info
    DoorsList = 'doorslist', -- Shows the list of doors the player has access to
    ToggleDoorlock = 'toggledoorlock', -- Locks or unlocks the nearby door (Works via keybind)
    RemoteTriggerDoor = 'remotetriggerdoor', -- Locks or unlocks the door being looked at remotely (Works via keybind)
}
Config.InventoryLink = 'auto' -- Set to 'auto' to auto-detect, or a string like 'nui://ox_inventory/web/images/'
Config.Consumables = { ['ticket'] = 1, ['paperclip'] = 1 } -- The items will get removed once used on a door that has the item on it
Config.LockpickItem = 'lockpick' -- Normal lockpick item
Config.LockpickBreakChance = 17 -- The percentage chance for the normal lockpick to break on failure
Config.AdvancedLockpickItem = 'advancedlockpick' -- Advanced lockpick item
Config.AdvancedLockpickBreakChance = 5 -- The percentage chance for the advanced lockpick to break on failure 


Minigame-Supported Lock Breaking#

Players can use specific items to play minigames and unlock doors.

lua
Config.MinigamesLabels = {
    [1] = "Default Lockpick",
    [2] = "Default Hacking",
    -- To add a new minigame, simply add a new ID and label here,
    -- and then define the logic for that ID in Config.Minigames below.
    -- Example: [3] = "My Custom Game",
}

Config.Minigames = {
    [1] = function(callback)
        if CoreName == "qb-core" or CoreName == "qbx_core" then
            -- Default QB-Core Lockpick
            local result = exports['qb-lockpick']:startLockpick()
            callback(result)
        elseif CoreName == "es_extended" then
            -- Replace with your ESX lockpick export/event
            -- Example: TriggerEvent('esx_lockpick:startLockpick', function(result) callback(result) end)
            callback(true) 
        else
            callback(true)
        end
    end,
    [2] = function(callback)
        if CoreName == "qb-core" or CoreName == "qbx_core" then
            -- Default PS-UI Circle Minigame
            exports['ps-ui']:Circle(function(success)
                callback(success)
            end, 2, 20) -- 2 circles, 20 ms
        elseif CoreName == "es_extended" then
            -- Replace with your ESX hack export/event
            callback(true)
        else
            callback(true)
        end
    end,
}