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

# Workbenches

Place workbenches and set who can use them, what they need and what they cost.

Workbenches are the spots where players open the hub. They live in `config/locations.lua`, inside `Config.Locations = { ... }`. Each one becomes an ox\_target or qb-target box zone, or an `[E]` prompt.

## The default bench

The script ships with one bench at the base-game Ammu-Nation in Pillbox Hill:

```lua
Config.Locations = {
    {
        id = 'ammunation_pillbox',
        label = 'Weapon Workshop',
        coords = vec3(17.98, -1108.42, 29.80),
        size = vec3(1.6, 1.2, 1.6),
        rotation = 340.0,
        distance = 2.0,
        jobs = nil,
        items = nil,
        price = nil,
        preview = nil,
        blip = { sprite = 110, color = 1, scale = 0.7, label = 'Weapon Workshop' },
        prop = nil,
    },
}
```

{% hint style="warning" %}
Using an Ammu-Nation MLO? The default coordinates are for the base-game shop. Move the bench.
{% endhint %}

## Add a bench in game

{% stepper %}
{% step %}

### Stand where the bench should be

Face the spot where players will stand and type **`/weaponhub_here`** (admins only).
{% endstep %}

{% step %}

### Paste the entry

A ready-made entry, including a `preview` display spot, is copied to your clipboard and printed in F8. Paste it into `Config.Locations` in `config/locations.lua`.
{% endstep %}

{% step %}

### Restart

`restart vision_weaponhub`. The bench is live.
{% endstep %}
{% endstepper %}

## Every field

| Field                        | Meaning                                                                                                                                                |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `id`                         | Any unique name                                                                                                                                        |
| `label`                      | Target / prompt text and blip name                                                                                                                     |
| `coords`, `size`, `rotation` | The box zone: centre, size and heading                                                                                                                 |
| `distance`                   | How close the player must be to use the target                                                                                                         |
| `jobs`                       | `nil` = everyone, or `{ police = 0, mechanic = 2 }` (job or gang → minimum grade)                                                                      |
| `items`                      | `nil`, or items the player must carry (not used up), for example `{ 'weapon_toolkit' }`                                                                |
| `price`                      | `nil`, or `{ amount = 500, account = 'cash' \| 'bank', charge = 'save' \| 'open' }`                                                                    |
| `preview`                    | `nil` = the weapon floats in front of the player, or `vec4(x, y, z, heading)` for a fixed display spot (heading = the direction the camera looks from) |
| `blip`                       | `false`, or `{ sprite, color, scale, label }`                                                                                                          |
| `prop`                       | `nil`, or `{ model = 'gr_prop_gr_bench_04b', coords = vec4(x, y, z, heading) }`, spawned locally near the bench                                        |

## Jobs and grades

```lua
jobs = { police = 2, mechanic = 0 },
```

This means the police job at grade 2 or higher, **or** the mechanic job at any grade. Gangs work the same way on Qbox and QBCore. A plain list means grade 0 or higher:

```lua
jobs = { 'police', 'sheriff' },
```

## Fees

```lua
price = { amount = 500, account = 'cash', charge = 'save' },
```

| `charge` | When the fee is taken                                                   |
| -------- | ----------------------------------------------------------------------- |
| `'save'` | Each time **Apply Changes** saves a change. Opening and looking is free |
| `'open'` | Once, when the bench is opened                                          |

The fee is added to any tint and camo colour prices, and the total is shown above **Apply Changes** before the player pays. Payment is taken before anything changes and refunded if the save fails.

## Examples

{% tabs %}
{% tab title="Police armory bench" %}

```lua
{
    id = 'mrpd_armory',
    label = 'Armory Workbench',
    coords = vec3(452.10, -980.20, 30.70),
    size = vec3(1.6, 1.2, 1.6),
    rotation = 90.0,
    distance = 2.0,
    jobs = { police = 0, sheriff = 0 },
    items = nil,
    price = nil,
    preview = nil,
    blip = false,
    prop = nil,
},
```

{% endtab %}

{% tab title="Paid gunsmith with a tool" %}

```lua
{
    id = 'gunsmith_paleto',
    label = 'Gunsmith',
    coords = vec3(-330.00, 6083.00, 31.45),
    size = vec3(1.6, 1.2, 1.6),
    rotation = 225.0,
    distance = 2.0,
    jobs = nil,
    items = { 'weapon_toolkit' },
    price = { amount = 500, account = 'cash', charge = 'save' },
    preview = nil,
    blip = { sprite = 110, color = 1, scale = 0.7, label = 'Gunsmith' },
    prop = { model = 'gr_prop_gr_bench_04b', coords = vec4(-330.40, 6083.40, 30.45, 225.0) },
},
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The coordinates in these examples are illustrations. Use `/weaponhub_here` to get exact ones for your map.
{% endhint %}

{% hint style="info" %}
The target only decides what is shown. The server repeats every check (distance, jobs, items, fees) when the bench opens and on every save. With the `[E]` prompt, no rules are shown, but the server still checks them all.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://visionstore.gitbook.io/visionstore-docs/scripts/weaponhub/configuration/workbenches.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
