> For the complete documentation index, see [llms.txt](https://docs.av-scripts.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.av-scripts.com/guides/illegal-runs/installation.md).

# 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="/files/3c6ALFjadGOJrg0UEXc5" 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="/files/4WdA3fQsiGINtPBtDQYz" 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.
