# Installation

Dependencies:

* Only compatible with ox\_inventory, qb-inventory, ps-inventory and lj-inventory.
* If you are using **qb-inventory, lj/ps-inventory** please make sure to follow this guide before using the script: <https://docs.av-scripts.com/laptop-pack/av-laptop/installation/inventory>
* Frameworks: ESX and QBCore.
* [ox\_lib](https://github.com/overextended/ox_lib/releases)
* [bl\_ui for minigames](https://github.com/Byte-Labs-Studio/bl_ui/releases)

## Add Runs

* In ***config/\_config.lua*** you will find the config for every drug available in runs, it only includes meth and coke but you can add as many drugs as you want by just copy/paste and editing the fields:

<figure><img src="https://1688068901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9bCwnajAqpi3Viykb5Wi%2Fuploads%2F7lFVBgbDB3MUamh3No37%2Fimage.png?alt=media&#x26;token=449e762e-94f9-4355-96ed-c0cf1ff1cc3f" alt=""><figcaption></figcaption></figure>

**Item name**: This is the name of the item and is used as table index, make sure it matches the item name from your inventory.

* **vehicle**: This is a table with a list of vehicle that will be spawned as **job vehicle***.*
* **moneyAccount***:* The account name used to pay the player after delivering the illegal packages.
* **cooldown**: Once the run is started, the mission will be turned off for everyone on server and added to a cooldown, make sure to keep this number higher than timeLimit.
* **timeLimit**: The time limit before the mission gets canceled and all vehicles/gang members wiped.
* **minQty**: This is the minimum quantity of packages the NPC will accept to start the mission, keep it interesting so not everyone farms this mission 24/7.
* **maxQty**: The max amount of drug bags a player can use for the run.
* **stashWeight**: If  your bag weight is 1kg or more do the maths and modify this value so you can deposit the maxQty items.
* **purityField**: The script will read the metadata from every deposited bag and it will retrieve the purity from this metadata field, if the bag doesn't have any metadata it will use 1% as purity.
* **basePrice**: The min price you will receive per package if quality is 1%.
* **maxPrice:** The max price you will receive per package if quality is 100%.
* **zones**: The amount of zones and packages that will be generated for the mission.
* **canInteract**: This is a function that needs to return booleand (true/false), it verifies who can talk to the NPC, by default cops can't interact with it.

## NPC Config

* The NPC config is located server side to prevent people from dumping the resource and get the spawn coords, to modify it go to **server/framework/\_config.lua.**
* **On every server restart** the script will pick a random location from the list for each NPC.
* Add a new NPC for every drug run and set the exact same name for both index key names (*the one that says "meth\_batch" is the exact same from Config.Drugs*).

<figure><img src="https://1688068901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9bCwnajAqpi3Viykb5Wi%2Fuploads%2F1HG0z4SorsG9uAbsKDzw%2Fimage.png?alt=media&#x26;token=78af9bdc-f2eb-4966-a2c6-b40e50d203da" alt=""><figcaption></figcaption></figure>

### Mission Locations and Weapons

* There's currently **50 locations** that are used randomly on every run making it pretty unique and preventing players from doing metagaming.
* When a mission is generated it picks a random group from the Config.PedGroups table, you can add your more groups.
* A random weapon from the Config.Weapons table is given to every gang member, feel free to add more or remove the ones you don't want to be used.


---

# 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://docs.av-scripts.com/guides/illegal-runs/installation.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.
