> For the complete documentation index, see [llms.txt](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/jiffy-jr-development-docs/jiffy-minigames/games/lockpick.md).

# Lockpick

<figure><img src="https://1591991476-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPIxZnZDGzl5v0n1I2OKQ%2Fuploads%2FIQZSacxSVxDCmDwgRsfi%2Fimage.png?alt=media&amp;token=7dbf25a8-88f5-467f-b908-8aed5a397f41" alt=""><figcaption></figcaption></figure>

A classic pin tumbler lockpick. Each pin must be pushed up to the shear line and held there. Push too far and the pin drops — the pick can also break if `breakChance` is set. Set all pins to win.

***

## Options

| Option        | Type   | Default    | Description                                                                                                          |
| ------------- | ------ | ---------- | -------------------------------------------------------------------------------------------------------------------- |
| `difficulty`  | string | `'medium'` | Preset. Sets `pins` when not overridden.                                                                             |
| `pins`        | number | `3`        | Number of pins in the lock (1–8).                                                                                    |
| `time`        | number | `30`       | Time limit in seconds.                                                                                               |
| `breakChance` | number | `0`        | 0–100. Percentage chance the pick breaks on each failed pin press, causing an instant fail. `0` = pick never breaks. |

***

## Example

```lua
-- Standard door lock:
exports['jiffy-minigames']:Lockpick({
    pins = 4,
    time = 25,
}, function(success)
    if success then
        TriggerServerEvent('my-script:server:unlockDoor', doorId)
    end
end)

-- High-security safe with pick break risk:
local success = exports['jiffy-minigames']:Lockpick({
    difficulty  = 'hard',
    breakChance = 30,
})
```

***

## Notes

* `difficulty` sets `pins` from the preset. Override `pins` explicitly if you want a specific count at a given difficulty speed/time.
* Set `breakChance = 0` (the default) for a forgiving experience where failure only costs time.
