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

# 💡 Installation

Installation guide of Vehicle Keys Script

## 💡 Installation

### Step 1: Move Resource

Extract the zip file you downloaded from Keymaster and place the **`fast-vehiclekeys`** folder into your server's `resources` folder.

{% hint style="warning" %}
Do **not** rename the folder. It must stay `fast-vehiclekeys` so exports, events and escrow work correctly.
{% endhint %}

### Step 2: Add the Items

Add the required items to your framework's item list (`vehiclekey`, `lockpick`, `advancedlockpick`). Make sure `vehiclekey` supports **metadata / info**. See Dependencies → Required Items.

### Step 3: Start Script

Ensure the resource in your `server.cfg`, **after** your framework, `ox_lib` and your MySQL resource:

```cfg
ensure oxmysql
ensure ox_lib
ensure qb-core        # or es_extended
# ...
ensure fast-vehiclekeys
```

### Step 4: Configure

Open `config.lua` and set at least:

* `Config.SQLScript` — your MySQL resource
* `Config.Items` — your item names
* `Config.Locksmiths` — locksmith locations
* `Config.InteractType` — how players interact with the locksmith

### Step 5: Set Vehicle Owners

For a player to have keys automatically, your garage/ownership script should tell Vehicle Keys who owns the vehicle when it spawns:

```lua
TriggerEvent("vehiclekeys:client:SetOwner", plate)
```

{% hint style="success" %}
That's it! Get in a car you own and press **`L`** (or run `/vehiclekey`) to open the key‑fob panel.
{% endhint %}

***

### Developer Events (Quick Reference)

You can interact with the vehicle keys system using the following events:

#### Set Vehicle Owner

Give the local player a key for the vehicle with the specified plate.

```lua
TriggerEvent("vehiclekeys:client:SetOwner", plate)
```

#### Give Temporary Key

Give a temporary key to the player for the vehicle with the specified plate.

```lua
TriggerServerEvent("fast-vehiclekeys:GiveTempKey", plate)
```

#### Remove Temporary Key

Remove the temporary key from the player for the specified vehicle.

```lua
TriggerServerEvent("fast-vehiclekeys:RemoveTempKey", plate)
```

> **Additional Information** — The `plate` refers to the vehicle's plate number (e.g. `"ABC123"`). This system can be used to manage vehicle ownership and give temporary keys to other players.
