> For the complete documentation index, see [llms.txt](https://crystal-studios.gitbook.io/crystal-studios-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://crystal-studios.gitbook.io/crystal-studios-docs/vehicle-keys/installation.md).

# Installation

Follow these step-by-step instructions to properly install Vehicle Keys (cr-carkeys) on your server.

{% hint style="info" %}
**Warning**

The resource folder must be named exactly `cr-carkeys` for the script and its exports to function correctly. Do not rename it!

This resource was tested on server artifacts `28954` and may not work correctly on older builds.
{% endhint %}

## Steps

{% stepper %}
{% step %}

### Download

* Download the resource from the official [**Cfx.re portal**](https://portal.cfx.re/).
* Extract the downloaded package.
* Move the entire folder: `cr-carkeys` into your server’s: `resources` directory.
  {% endstep %}

{% step %}

### Dependencies

Make sure that you have installed these [dependencies](/crystal-studios-docs/vehicle-keys/dependencies.md)
{% endstep %}

{% step %}

### Server config

Add the following line to your `server.cfg` to start the resource:

`ensure cr-carkeys`.

This guarantees the script will load automatically on every server restart.
{% endstep %}

{% step %}

### Add Items to Your Inventory

#### ⚠️ Important Note

> At the moment vehicle keys supports only `qb-inventory` and `ox_inventory` .

Now you need to add the items. Below are instructions for **qb-inventory** and **ox\_inventory**.

{% tabs %}
{% tab title="qb-inventory" %}

1. Go to your `qb-core` folder.
2. Open the file: `/shared/items.lua`
3. Scroll to the **end of the file**.
4. Before the closing `}` add the following code:

```
lockpick = { name = 'lockpick', label = 'Lockpick', weight = 300, type = 'item', image = 'lockpick.png', unique = false, useable = true, shouldClose = true, description = 'Very useful if you lose your keys a lot.. or if you want to use it for something else...' },
```

```
vehkey = {name = 'vehkey', label = 'Vehicle Key', weight = 0, type = 'item', image = 'vehkey.png', unique = true, useable = false, shouldClose = false, description = 'A key to unlock a vehicle.'}
```

{% endtab %}

{% tab title="ox\_inventory" %}

1. Go to your `ox_inventory` folder.
2. Open the file: `/data/items.lua`
3. Scroll to the **end of the file**.
4. Before the closing `}` add the following code:

```lua
['lockpick'] = {
    label = 'Lockpick',
    description = 'Very useful if you lose your keys a lot.. or if you want to use it for something else...',
    weight = 300,
},

['vehkey'] = {
    label = 'Vehicle Keys',
    description = 'A key to unlock a vehicle.',
    weight = 100,
    stack = true,
    close = true,
    client = {
        image = 'vehkey.png',
    }
},
```

{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

### Add Item Images

{% tabs %}
{% tab title="qb-inventory" %}

1. Go to your `cr-carkeys` folder.
2. Open the folder: `/_assets/` .
3. Copy the provided `lockpick.png` and `vehkey.png` .
4. Place them in `qb-inventory/html/images/` .
   {% endtab %}

{% tab title="ox\_inventory" %}

1. Go to your `cr-carkeys` folder.
2. Open the folder: `/_assets/` .
3. Copy the provided `lockpick.png` and `vehkey.png` .
4. Place them in `ox_inventory/web/images/` .
   {% endtab %}
   {% endtabs %}
   {% endstep %}
   {% endstepper %}

{% hint style="info" %}
**IMPORTANT**

Before adding items, ensure that the 'lockpick' and 'vehkey' items do not already exist in your framework / inventory configuration. If they do, you can skip this step or adjust their parameters to match your preferences
{% 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://crystal-studios.gitbook.io/crystal-studios-docs/vehicle-keys/installation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
