# Setup and Items

This page covers the minimum setup required to get the script running correctly: dependencies, `server.cfg` start order, and required item installation.

## Required Dependencies

* [oxmysql](https://github.com/overextended/oxmysql/releases)
* [ox\_lib](https://github.com/overextended/ox_lib/releases)
* `0r_lib`

## Recommended server.cfg Start Order

Use a clean start order so the script loads after its dependencies:

```lua
start oxmysql
start ox_lib
start framework -- es_extended, qb-core, qbx_core, etc.
-- other resources
start 0r_lib
start 0r-heistpack
```

{% hint style="info" %}
The profile table is created automatically by the script on resource start. You do not need to import SQL manually for normal setup.
{% endhint %}

## Database Setup

You do not need to run a manual SQL import for this script.

The resource automatically creates the required profile table on start:

```sql
CREATE TABLE
    IF NOT EXISTS `0resmon_heist_profiles` (
        id INT AUTO_INCREMENT PRIMARY KEY,
        identifier VARCHAR(255) NOT NULL UNIQUE,
        illegal_nickname VARCHAR(255) DEFAULT NULL,
        photo INT DEFAULT 1,
        exp INT DEFAULT 0,
        credits INT DEFAULT 0,
        created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
        updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
    );
```

That means your only job is making sure:

* `oxmysql` is installed and starts before `0r-heistpack`
* The script starts without SQL errors in console
* You do not block the table creation with an old broken database setup

## Localization Setup

This script uses `ox_lib` localization.

Set your server language in `server.cfg`:

```cfg
set ox:locale "en"
```

If you want another language, create or edit the matching locale file by following the same structure as the default locale file included in the script.

{% hint style="info" %}
Localization belongs to setup because it is part of the first install. You normally finish this once, then move on to scenario balancing later.
{% endhint %}

## Where Do I Add The Items?

* If you use OX Inventory, add the items to `ox_inventory/data/items.lua` and the required weapons to `ox_inventory/data/weapons.lua`.
* If you use QB Core, add the items to `qb-core/shared/items.lua`.
* Copy the item images into the image folder used by your inventory.
* The script item images are already included in `ui/build/items`.

The script source also includes a generated full reference list in:

```lua
read-me/items.lua
```

Use that file if you want to copy the complete item list used by the resource, not only the minimum startup items shown on this page.

{% hint style="warning" %}
Make sure `heistpack_tablet` exists if your package uses the tablet-based access flow.
{% endhint %}

{% hint style="info" %}
`heistpack_tablet` is automatically registered as a usable item by the script when `Config.heistMenu.openWithItem.enabled = true` in `config/main.lua`. If you disable item-based menu opening, the tablet item is no longer required for menu access.
{% endhint %}

## OX Inventory

{% tabs fullWidth="false" %}
{% tab title="weapons.lua" %}

```lua
['WEAPON_HACKINGDEVICE'] = {
	label = 'Hacking Device',
	weight = 1000,
	durability = 0.0,
},
```

{% endtab %}

{% tab title="items.lua" %}

```lua
--- # start 0r-heistpack
['heistpack_drone']   = { label = 'Heist Drone', weight = 0.0, stack = true },
['gasmask']           = { label = 'Gas Mask', weight = 0.0, stack = true },
['heistpack_drill']   = { label = 'Heist Drill', weight = 0.0, stack = true },
['lockpick']          = { label = 'Lockpick', weight = 0.0, stack = true },
['heavy_rope']        = { label = 'Heavy Rope', weight = 0.0, stack = true },
['heistpack_anchor']  = { label = 'Anchor', weight = 0.0, stack = true },
['heistpack_grinder'] = { label = 'Angle Grinder', weight = 1.0, stack = true },
['heistpack_tablet']  = { label = 'Heistpack Tablet', weight = 1.0, stack = true },
['heist_paint_1']     = { label = 'Painting #1', weight = 500, stack = false, client = { image = "heist_painting.png" } },
['heist_paint_2']     = { label = 'Painting #2', weight = 500, stack = false, client = { image = "heist_painting.png" } },
['heist_paint_3']     = { label = 'Painting #3', weight = 500, stack = false, client = { image = "heist_painting.png" } },
['heist_paint_4']     = { label = 'Painting #4', weight = 500, stack = false, client = { image = "heist_painting.png" } },
--- # end 0r-heistpack
```

{% endtab %}
{% endtabs %}

## QB Core

{% tabs fullWidth="false" %}
{% tab title="shared/weapons.lua" %}

```lua
[`WEAPON_HACKINGDEVICE`] = { name = 'weapon_hackingdevice', label = 'Hacking Device', weapontype = 'Miscellaneous', ammotype = nil, damagereason = 'Miscellaneous' },
```

{% endtab %}

{% tab title="shared/items.lua" %}

```lua
heistpack_drone   = { name = 'heistpack_drone', label = 'Heist Drone', weight = 1000, type = 'item', image = 'heistpack_drone.png', unique = false, useable = true, shouldClose = true, description = 'Remote-controlled drone used in heist scenarios' },
gasmask           = { name = 'gasmask', label = 'Gas Mask', weight = 500, type = 'item', image = 'gasmask.png', unique = false, useable = true, shouldClose = false, description = 'Protects against toxic gas during robberies' },
heistpack_drill   = { name = 'heistpack_drill', label = 'Heist Drill', weight = 2000, type = 'item', image = 'heistpack_drill.png', unique = false, useable = true, shouldClose = true, description = 'High-power drill for vaults and secure doors' },
lockpick          = { name = 'lockpick', label = 'Lockpick', weight = 200, type = 'item', image = 'lockpick.png', unique = false, useable = true, shouldClose = false, description = 'Used to unlock basic doors and vehicles' },
heavy_rope        = { name = 'heavy_rope', label = 'Heavy Rope', weight = 800, type = 'item', image = 'heavy_rope.png', unique = false, useable = true, shouldClose = false, description = 'Strong rope for climbing or securing objects' },
heistpack_anchor  = { name = 'heistpack_anchor', label = 'Anchor', weight = 1500, type = 'item', image = 'heistpack_anchor.png', unique = false, useable = true, shouldClose = true, description = 'Anchor used in cargo ship robbery scenarios' },
heistpack_grinder = { name = 'heistpack_grinder', label = 'Angle Grinder', weight = 1500, type = 'item', image = 'heistpack_grinder.png', unique = false, useable = true, shouldClose = true, description = 'Angle Grinder used in ammunation robbery scenarios' },
heistpack_tablet  = { name = 'heistpack_tablet', label = 'Heistpack Tablet', weight = 1500, type = 'item', image = 'heistpack_tablet.png', unique = false, useable = true, shouldClose = true, description = 'Heistpack tablet' },
heist_paint_1     = { name = 'heist_paint_1', label = 'Painting #1', weight = 500, type = 'item', image = 'heist_painting.png', unique = true, useable = true, shouldClose = false, description = 'Painting #1' },
heist_paint_2     = { name = 'heist_paint_2', label = 'Painting #2', weight = 500, type = 'item', image = 'heist_painting.png', unique = true, useable = true, shouldClose = false, description = 'Painting #2' },
heist_paint_3     = { name = 'heist_paint_3', label = 'Painting #3', weight = 500, type = 'item', image = 'heist_painting.png', unique = true, useable = true, shouldClose = false, description = 'Painting #3' },
heist_paint_4     = { name = 'heist_paint_4', label = 'Painting #4', weight = 500, type = 'item', image = 'heist_painting.png', unique = true, useable = true, shouldClose = false, description = 'Painting #4' },
weapon_hackingdevice = { name = 'weapon_hackingdevice', label = 'weapon_hackingdevice', weight = 1000, type = 'weapon', ammotype = nil, image = 'weapon_hackingdevice.png', unique = true, useable = true, description = 'weapon_hackingdevice' },
```

{% endtab %}
{% endtabs %}

## Final Checklist

After setup, verify these points:

* `0r_lib` starts without errors
* `0r-heistpack` starts without errors
* The automatic database table is created without errors
* Your `ox:locale` value matches the locale you want to use
* Required items exist in game
* Item images load correctly
* The scenario flow can start without missing dependency errors
