# Lockpick Item Setup

Add lockpick items to your inventory

{% tabs %}
{% tab title="qb-inventory" %}
Has lockpick and advancedlockpick items by default
{% endtab %}

{% tab title="ox\_inventory" %}
Has lockpick by default.&#x20;

Add advancedlockpick to `ox_inventory/data/items.lua`&#x20;

```lua
['advancedlockpick'] = {
     label = 'Advanced Lockpick',
     weight = 160,
},

```

{% endtab %}
{% endtabs %}

If you are using the same items as lockpicks in this script as used in other scripts you must make the following changes.&#x20;

Navigate to `config/config.lua` Locate `Config.Lockpick` and set the following:

If using existing lockpick item:

```lua
UseExistingLockpickEvent = true,
```

You will need to trigger the following event when your lockpick is used

```lua
TriggerClientEvent('MK_VehicleKeys:Client:UseLockpick', source, 'lockpick', {Advanced = false})

```

If using existing advancedlockpick item:

```lua
UseExistingAdvancedLockpickEvent = true,
```

You will need to trigger the following event when your lockpick is used

```lua
TriggerClientEvent('MK_VehicleKeys:Client:UseLockpick', source, 'advancedlockpick', {Advanced = true})

```

Examples:

{% tabs %}
{% tab title="qb-core" %}
Navigate to `qb-smallresources/server/consumables.lua`&#x20;

Locate `QBCore.Functions.CreateUseableItem("lockpick", function(source)` function and add the TriggerClientEvent into it like this

```lua
QBCore.Functions.CreateUseableItem("lockpick", function(source)
    TriggerClientEvent("lockpicks:UseLockpick", source, false)
    TriggerClientEvent('MK_VehicleKeys:Client:UseLockpick', source, 'lockpick', {Advanced = false})
end)

```

Locate `QBCore.Functions.CreateUseableItem("advancedlockpick", function(source)` function and add the TriggerClientEvent into it like this

```lua
QBCore.Functions.CreateUseableItem("advancedlockpick", function(source)
    TriggerClientEvent("lockpicks:UseLockpick", source, true)
    TriggerClientEvent('MK_VehicleKeys:Client:UseLockpick', source, 'advancedlockpick', {Advanced = true})
end) 

```

{% endtab %}

{% tab title="qbx" %}
Navigate to `qbx_smallresources/qbx_consumables/server.lua`&#x20;

Locate `exports.qbx_core:CreateUsableItem('lockpick', function(source)` function and add the TriggerClientEvent into it like this

```lua
exports.qbx_core:CreateUseableItem('lockpick', function(source)
    TriggerClientEvent('lockpicks:UseLockpick', source, false)
    TriggerEvent('lockpicks:UseLockpick', source, false)
    TriggerClientEvent('MK_VehicleKeys:Client:UseLockpick', source, 'lockpick', {Advanced = false})
end)

```

Locate `exports.qbx_core:CreateUsableItem('advancedlockpick', function(source)` function and add the TriggerClientEvent into it like this

```lua
exports.qbx_core:CreateUseableItem('advancedlockpick', function(source)
    TriggerClientEvent('lockpicks:UseLockpick', source, true)
    TriggerEvent('lockpicks:UseLockpick', source, true)
    TriggerClientEvent('MK_VehicleKeys:Client:UseLockpick', source, 'advancedlockpick', {Advanced = true})
end)

```

{% endtab %}
{% endtabs %}
