This script allows players to lock NPC vehicles and perform vehicle lockpicking. It has been thoroughly tested with the ESX framework and provides a robust system for managing vehicle locking and unlocking using a lockpick minigame. A bridge for QB Core has been added, but it has not been fully tested with QB.
Although compatibility for QB Core has been added, it has not been tested in the same way as the ESX version. QB Core already provides its own vehicle lockpicking system, which works efficiently. Therefore, it is recommended to use this script with ESX for better stability and reliability. If you choose to use it with QB, be aware that it may not work as expected.
- ESX Framework (fully tested)
- QB Core Framework (use at your own risk, not fully tested)
- Lockpick Minigame Resource (required for lockpicking interaction) - Lockpick Dependency
- OX Inventory or QB Inventory (for handling the lockpick item in inventories)
-
Place the
forge-closeNPCfolder in yourresourcesdirectory. -
Add the following to your
server.cfg:ensure forge-closeNPC
-
Install the required dependencies (ESX or QB Core, Lockpick minigame, OX Inventory if applicable).
The script can be configured via the config.lua file. Here are some important options:
-
Framework Selection: Choose between
ESXandQBinconfig.lua.Config.Framework = 'ESX' -- or 'QB'
-
Inventory System: If using QB, ensure that the correct inventory system is configured.
Config.Inventory = 'OX' -- or 'QB'
-
Lock Type: Define the type of locking mechanism used for NPC vehicles.
Config.LockType = 2 -- Refer to FiveM docs for more types
-
Debug Mode: Enable or disable debug messages.
Config.Debug = true
This script provides the following exports to interact with the lockpicking functionality:
- startLockpick
- Usage:
exports['forge-closeNPC']:startLockpick() - Description: Initiates the lockpicking minigame for the player.
- Usage:
This script relies on the following resources:
- ESX or QB Core framework.
- Lockpick Minigame Resource (
lockpick) - Lockpick Dependency - OX Inventory or QB Inventory (for managing lockpick items).
For technical support, please join the CodeForge Discord: CodeForge Discord