> For the complete documentation index, see [llms.txt](https://tk-scripts.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tk-scripts.gitbook.io/docs/tk_houserobbery/common-questions-and-problems.md).

# Common questions & problems

Fixes for common Advanced House Robbery V2 errors on a FiveM server, and answers to the questions server owners ask most.

## Common questions

<details>

<summary>How do I add more houses?</summary>

Add `{coords = vector3(x, y, z)},` at the door to `Config.Entrances`. Add `interior = 2` to give it a fixed interior from `Config.Houses`; without it, the house gets a random one.

</details>

<details>

<summary>How do I connect my dispatch script?</summary>

`tk_dispatch` and `cd_dispatch` work with `Config.Dispatch = 'tk'` or `'cd'`. For another script, such as ps-dispatch, add its alert export in `AlertPolice(coords)` in `client/main_editable.lua`; the `tk` and `cd` branches there show the shape. The alert titles and texts are in that function, not in the locale files.

</details>

<details>

<summary>How do I start the job from a ped instead of a phone booth?</summary>

Add the ped and its interaction yourself, and run this when the player accepts the job:

```lua
TriggerCallback('tk_houserobbery:addEntrance', function(houseIndex)
    if not houseIndex or type(Config.Entrances[houseIndex]) ~= 'table' then return end

    AcceptJob(Config.Entrances[houseIndex].coords)
end)
```

It picks a free house, starts `Config.Cooldown.user` and calls `AcceptJob` in `client/main_editable.lua`, which sets the GPS waypoint. It needs `Config.UsePhoneBooths = true`.

</details>

<details>

<summary>How do I make lockpicking harder or easier?</summary>

In `DoDoorLockpickMinigame` and `DoSafeLockpickMinigame` in `client/main_editable.lua`, each `math.random(0,99)` is one stage of the pd-safe lock. Remove one for an easier lock or add one for a harder lock. `Config.LockpickLoseChance` sets how often the lockpick breaks.

</details>

<details>

<summary>Can I translate House Robbery?</summary>

Yes. English, Finnish and French ship with it. For another language, copy `locales/en.lua` to `locales/de.lua`, change `Locales['en']` on its first line to `Locales['de']`, translate the texts and set `Config.Locale = 'de'`; the menus read the same file. The phone booth chats in `Config.Conversations`, the shop names in `Config.Shops` and `Config.SellShops`, and the dispatch alert texts in `AlertPolice` are not in the locale file; translate them where they are.

</details>

<details>

<summary>How do House Robbery interiors work? What if I use Liberty City?</summary>

The script uses IPL interiors that exist in the GTA V map, most of them below the main map. Edit their positions in [`Config.Houses`](/docs/tk_houserobbery/config.md#interiors); shell interiors do not work. On Liberty City or another map, every interior you list must exist on that map.

</details>

<details>

<summary>Can players rob any house without the phone booth?</summary>

Yes. Set `Config.UsePhoneBooths = false`, and every door in `Config.Entrances` can be picked. `Config.Cooldown.user` then starts after each successful lockpick.

</details>

<details>

<summary>Why do police not get an alert every time?</summary>

An alert goes out only when a lockpick roll hits or the homeowner wakes up: `Config.LockpickAlertChance` is `fail = 40`, `start = 0`, `success = 0`, and `Config.NPC.alertChance` is `50`. A player also sends at most one alert every 30 seconds. Raise the chances to alert more often.

</details>

<details>

<summary>Can several players rob a house together, and can police enter?</summary>

Yes to both. Once one player picks the door, anyone can walk in without picking it, and players whose job is in `Config.PoliceJobs` can enter any house door without a lockpick.

</details>

<details>

<summary>Why do some houses have no paintings, rubies or safes?</summary>

Each entry in the `valuables` of a house in `Config.Houses` has its own `spawnChance`, rolled once per robbery; the download uses 5 to 50. Set `spawnChance = 100` for a valuable that is always there. Search spots and carry items are always there.

</details>

<details>

<summary>Does House Robbery work on Qbox?</summary>

Yes. Qbox runs the QBCore files, so set `Config.Framework = 'qb'`.

</details>

<details>

<summary>Does House Robbery use routing buckets?</summary>

Yes. Each house puts its players in its own routing bucket, numbered by the house's position in `Config.Entrances`, starting at 1, and players go back to bucket 0 when they leave. If another script also uses buckets 1 and up, players from both scripts can meet.

</details>

## Common problems

### Lockpicking always succeeds

When a player picks a door or safe, the F8 console prints:

```
[WARNING] pd-safe resource not started. Skipping lockpick minigame. Install pd-safe or change minigame in client/main_editable.lua
```

`pd-safe` is not running, so the minigame is skipped and counts as a success.

* Install `pd-safe` and add `ensure pd-safe` before `ensure tk_houserobbery` in `server.cfg`.
* Or put another minigame in `DoDoorLockpickMinigame` and `DoSafeLockpickMinigame` in `client/main_editable.lua`.

With `Config.DebugMode = true`, every minigame is skipped as well. A player whose job is in `Config.PoliceJobs` walks into every house without picking it, so test with another job.

### Lasers turn off without a minigame

Hacking a security panel prints this in the F8 console:

```
[WARNING] bl_ui resource not started. Skipping minigame. Install bl_ui or change minigame in client/main_editable.lua
```

`bl_ui` is not running. Start it before `tk_houserobbery`, or replace the minigame in `DoSecurityDisableMinigame`.

### No target option on doors, phone booths or loot

Doors, phone booths and search spots show a key prompt instead of a target option. `Config.Target` is `'none'` by default. Set it to `'ox'` or `'qb'`, and start `ox_target` or `qb-target` before `tk_houserobbery`.

### ox\_lib is not loaded

When a prompt or notification shows, the F8 console prints:

```
SCRIPT ERROR: @tk_houserobbery/client/main_editable.lua:145: attempt to index a nil value (global 'lib')
```

`Config.UseOxLib` is `true` or `Config.NotificationType` is `'ox'`, but `tk_houserobbery` does not load ox\_lib. In `tk_houserobbery/fxmanifest.lua`, remove the `--` in front of `'@ox_lib/init.lua',` and keep the `@`, and put `ensure ox_lib` before `ensure tk_houserobbery` in `server.cfg`.

### Valuables do not work

When a valuable spawns, the server console prints:

```
[WARNING] Script will not work properly, update your server artifacts.
```

Your FXServer build is too old for the painting and ruby animations. Update the server artifacts to a recent recommended build.

### No more entrances available

A player at a phone booth gets this notification:

```
No more entrances available
```

Every house in `Config.Entrances` is taken by a job, being robbed, or on its `Config.Cooldown.house` timer.

* Lower `Config.Cooldown.house`.
* Add more doors to [`Config.Entrances`](/docs/tk_houserobbery/config.md#entrances).

### Loot items are not defined

On ESX, a search or a shop menu makes es\_extended print `attempt to concatenate a nil value (local 'item')`, and the trace contains this line:

```
> GetItemLabel (@tk_houserobbery/server/frameworks/esx.lua:135)
```

An item from `Config.LootItems`, `Config.CarryItems`, `Config.Items` or the shops is missing from your inventory's item list. Add the items as in [House Robbery installation](/docs/tk_houserobbery/installation.md#install), step 6.

### A carried item disappears in the vehicle

A player stores a television, computer or other carried object in a vehicle, the stored notification shows, and the item never arrives. The script removes the object first and then adds the item, so an item the inventory refuses is lost.

* The inventory has no room, and the player gets this notification:

  ```
  Not enough space
  ```

  Raise the inventory's weight limit, or lower the item's weight.
* The `reward` item of that entry in `Config.CarryItems` is missing from your inventory's item list. Add the items as in [House Robbery installation](/docs/tk_houserobbery/installation.md#install), step 6.

### Item images are missing in the shop menus

The shop and sell menus load images from `Config.ImagePath`, which points at ox\_inventory by default.

1. Copy the icons from `tk_houserobbery/images/` into your inventory's image folder.
2. On qb-inventory, set `Config.ImagePath = 'nui://qb-inventory/html/images'`.

### The dealer does not buy statues

Searches give `statue`, but `Config.SellShops` in the download lists `trading_statue` instead. Add `{name = 'statue', price = 140},` to the dealer's `items` in `config.lua`.
