# Setting up a vehicle

{% embed url="<https://streamable.com/8i2s3m>" %}

## Basic quick setup

1. Enable debug in **config.lua**
2. Go to the vehicles folder and create a new **.lua** file (*You can name it whatever you want*)
3. Copy all the text from another vehicle that I already have made
4. Change or add all things you will need
5. You can use **/vehoffset** when inside a car to start creating a boxzone / offset

## Vehicle setup breakdown

* For example  `Config.offset['voodoofoodt']`  where voodoofoodt the **displayname is** for the vehicle. This is given after you create a **boxzone / offset.**\
  The job vehicle is defined with and underscore for example `voodoofoodt_cluckinbell`\
  So **Displayname** \_ **Jobname**
* **carspawnname** is the spawnname of the vehicle.
* **targets** is where you will setup the target zones / offset.

## Target breakdown

* **Zonetype** is the type of the zone. This can be whatever you want or one of these below.
  * **`cooking`** for a cookingplate or grill for example
  * **`prepare`** for a cuttingboard or something
  * **`drink`** is for a sodamachine or fridge or something
  * **`cashregister`** is to open the cashregister which you have to make work yourself or copy from the qb lua file
  * **`storage`** is to have a small storage which you can define the values of in each vehicle file
  * **`fridge`** is to have a shop in the vehicle (for example qb-shops)
  * **`frying`** is for like a frying pan position
  * **`counter`** you will have to make it synced so anyone can access it
* **`syncedZone`** if true will make the zone so anyone can interact with it
* **`targeticon`** is the icon to show on the ox target
* **`label`** is the text shown for the target
* **`Offset and BoxSize`** are the values you will get after creating a zone with the editor
* **`model`** will place a prop if not nil on the position of the zone
* **`event`** can be server , client or function but you will have to define the event yourself so you can basicaly trigger anything

## Event

You have 3 types of event / func you could use

* Server
* Client
* Function

A function will be default ***nil*** to disable it.

To use a function edit it like below:

```
func = function() -- nil to disable function event
end,
```

The order it will check which to use is\
Server event -> Function -> Client event -> default events

## Animation

* You can edit the animation and the prop for the default zonetypes&#x20;

## CreateStages

* This is to add a prop to the center of the zone when for example cooking
* For examplke: `['bacon']` Is the item spawn name `[1] = 'raw_bacon'` is the prop name

## Stash

* Define the stash size and slots

## Register

* Header url for the jim payment cash register

## Fridge

* Create / Define a shop for example for qb-shop

## Recepies

* Here you will find all predefined zones
* Each zone can have its own recepy attached to it
* \[itemname] = amount you make + a table of all items needed to make it


---

# Agent Instructions: 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:

```
GET https://flexiboi.gitbook.io/flexiboi/paid/flex-truck/setting-up-a-vehicle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
