> For the complete documentation index, see [llms.txt](https://documentation.rcore.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.rcore.cz/paid-resources/rcore_housing/configuration/minigames.md).

# Minigames

Edit `rcore_housing/configs/config.minigames.lua` to swap in your own minigame implementations.

## 🎮 Defaults

```lua
Config.Minigames = {
    Lockpicking = { Default = true, Custom = function() end },
    Breach      = { Default = true, Custom = function() end },
    SafeCracking = { Default = true, Custom = function() end },
}
```

Each entry has two fields:

| Field     | Description                                                                                           |
| --------- | ----------------------------------------------------------------------------------------------------- |
| `Default` | When `true`, the built-in minigame implementation is used.                                            |
| `Custom`  | A function called instead of the default when `Default = false`. Receives context-specific arguments. |

## 🔧 Custom Overrides

| Minigame       | Function Signature                    | Used By                         |
| -------------- | ------------------------------------- | ------------------------------- |
| `Lockpicking`  | `function(doorId, data) ... end`      | Lockpicking a property door.    |
| `Breach`       | `function(propertyId, data) ... end`  | Police breach during a raid.    |
| `SafeCracking` | `function(furnitureId, data) ... end` | Cracking a safe furniture item. |

Return `true` from the custom function to indicate success, `false` to fail.

```lua
Config.Minigames.Lockpicking = {
    Default = false,
    Custom = function(doorId, data)
        return exports['your_minigame']:Start({ difficulty = data.level })
    end,
}
```

{% hint style="info" %}
Difficulty for the built-in lockpick scales by anti-burglary door level. If you replace the minigame, read the level from `data` and apply it in your own implementation.
{% endhint %}
