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

# Vehicle Keys

## Vehicle Keys

Give and remove vehicle keys through supported key systems. Use when a player buys, rents, or steals a vehicle.

### Supported resources

* `qb-vehiclekeys`
* `qbx_vehiclekeys`
* `qs-vehiclekeys`
* `mk_vehiclekeys`
* `0r-vehiclekeys`
* `MrNewbVehicleKeys`
* `t1ger_keys`
* `mVehicle`
* `okokGarage`

### Functions

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>GetResource</strong></td><td>Returns vehicle key resource name.</td><td><a href="#getresource">#getresource</a></td></tr><tr><td><strong>Give</strong></td><td>Give player(self) the keys of specified vehicle.</td><td><a href="#give">#give</a></td></tr><tr><td><strong>Remove</strong></td><td>Remove specified vehicle keys from player(self).</td><td><a href="#remove">#remove</a></td></tr><tr><td><strong>SetResource</strong></td><td>Force set vehicle key resource.</td><td><a href="#setresource">#setresource</a></td></tr></tbody></table>

***

## GetResource

Returns vehicle key resource name.

{% hint style="info" %}
**Side:** Client · **Category:** Vehicle Keys · **API:** `LT.VehicleKeys.GetResource`
{% endhint %}

### Example

```lua
local result = LT.VehicleKeys.GetResource()
```

### Returns

* `'qb-vehiclekeys'|'qbx_vehiclekeys'|'qs-vehiclekeys'|'mk_vehiclekeys'|'0r-vehiclekeys'|'MrNewbVehicleKeys'|'t1ger_keys'|'mVehicle'|'okokGarage'|nil`

***

## Give

Give player(self) the keys of specified vehicle.

{% hint style="info" %}
**Side:** Client · **Category:** Vehicle Keys · **API:** `LT.VehicleKeys.Give`
{% endhint %}

### Example

```lua
local result = LT.VehicleKeys.Give(1, 'plate')
```

### Parameters

| Name      | Required | Description      |
| --------- | -------- | ---------------- |
| `vehicle` | Yes      | Vehicle entity.  |
| `plate`   | No       | Plate of vehicle |

### Returns

* `boolean`

***

## Remove

Remove vehicle keys from the local player. Plate is read from the entity when omitted.

{% hint style="warning" %}
`t1ger_keys` and `mVehicle` do not support key removal — the call logs an error but still returns `true`.
{% endhint %}

{% hint style="info" %}
**Side:** Client · **Category:** Vehicle Keys · **API:** `LT.VehicleKeys.Remove`
{% endhint %}

### Example

```lua
LT.VehicleKeys.Remove(vehicle, 'ABC123')
```

### Parameters

| Name      | Required | Description      |
| --------- | -------- | ---------------- |
| `vehicle` | Yes      | Vehicle entity.  |
| `plate`   | No       | Plate of vehicle |

### Returns

* `boolean`

***

## SetResource

Force set vehicle key resource.

{% hint style="info" %}
**Side:** Client · **Category:** Vehicle Keys · **API:** `LT.VehicleKeys.SetResource`
{% endhint %}

### Example

```lua
LT.VehicleKeys.SetResource('qb-vehiclekeys')
```

### Parameters

| Name   | Required | Description      |
| ------ | -------- | ---------------- |
| `name` | Yes      | 'qb-vehiclekeys' |
