πŸͺ› Lock Picking

Access a comprehensive guide that includes a detailed installation process, examples of code, previews of configurations.

Links:

INSTALLATION GUIDE

Step 0 - First Steps

1. Download your resource from FiveM's Keymaster 2. Unzip the inside-lockpicking folder and place this folder in your server's resource folder. 3. Add the resource to your server start config (server.cfg): ensure inside-lockpicking If you are using a framework, it must be placed anywhere below your framework resource e.g., es_extended, not above.

ensure es_extended ensure inside-lockpicking

Step 1 - Configure Resource

You MUST read all configurable options inside the[inside-lockpicking/config.lua] file and configure them to suit your server's needs.

How do i use it?

You can start the lock picking by using the default settings.

-- Initiates the lockpicking minigame and stores the result
local result = exports['inside-lockpicking']:StartLockPicking()

-- Checks the result of the minigame
if result == 'success' then
    -- This section is executed if the player wins the minigame
    print('Congratulations, you succeeded!')
elseif result == 'fail' then
    -- This section is executed if the player loses the minigame
    print('Unfortunately, you did not succeed this time.')
end

Example 2

Or you can use the start the lock picking by sending customized settings in a table.

Remember to use item requirements, first configure config.lua correctly to check if the player has a given item.

-- Table with settings
local settings = {
    difficulty = 'hard', -- easy, medium, hard
    requiredItem = 'lockpick', -- item name
    requiredAmount = 1 -- quantity
}

-- Initiates the lockpicking minigame and stores the result
local result = exports['inside-lockpicking']:StartLockPicking(settings)

-- Checks the result of the minigame
if result == 'success' then
    -- This section is executed if the player wins the minigame
    print('Congratulations, you succeeded!')
elseif result == 'fail' then
    -- This section is executed if the player loses the minigame
    print('Unfortunately, you did not succeed this time.')
elseif result == 'no_item' then 
    -- If the player does not have a given number of items in the inventory
    print('You need the required item to start this minigame.')
end

Last updated