# Config

## 1. Framework

The first step to configure the script is selecting your framework. The script is delivered with an automatic framework detection feature, but you can still change it to yours.

```lua
cfg.framework = 'SELECTED FRAMEWORK HERE'
```

{% hint style="info" %}
New ESX relies on the export to bring in the framework object, on the other hand old esx triggers the event to bring in the object.
{% endhint %}

<table><thead><tr><th width="236">Framework</th><th>Config</th></tr></thead><tbody><tr><td>Auto Detect</td><td><code>cfg.framework = '</code>auto-detect<code>'</code></td></tr><tr><td>New ESX</td><td><code>cfg.framework = 'new_esx'</code></td></tr><tr><td>Old ESX</td><td><code>cfg.framework = 'old_esx'</code></td></tr><tr><td>QBCore</td><td><code>cfg.framework = 'qbcore'</code></td></tr><tr><td>Qbox</td><td><code>cfg.framework = 'qbox'</code></td></tr></tbody></table>

{% hint style="warning" %}
if you have renamed your core you will most likely have to make some adjustments at the top of the `open.lua` files in the `client` and `server` folder.
{% endhint %}

## 2. Interaction Method

The second step is selecting the way of interacting with the script.&#x20;

```
cfg.interaction == 'SELECTED INTERACTION HERE'
```

{% hint style="info" %}
HelpNotification is the interaction used in GTA:O and is built by default. Picture: <img src="https://2957144486-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZsLjvLlg6JtaiFW5xcvM%2Fuploads%2FoOatwOhieBJkSapChFn0%2Fimage.png?alt=media&#x26;token=55355825-b48a-4f99-a949-50c5af8aecaf" alt="" data-size="original">
{% endhint %}

<table><thead><tr><th width="238">Interaction</th><th>Dependency</th></tr></thead><tbody><tr><td><code>HelpNotification</code></td><td>/</td></tr><tr><td><code>qb-drawtext</code></td><td>QBCore Framework</td></tr><tr><td><code>qb-target</code></td><td><a href="https://github.com/qbcore-framework/qb-target">https://github.com/qbcore-framework/qb-target</a></td></tr><tr><td><code>qtarget</code></td><td><a href="https://github.com/overextended/qtarget">https://github.com/overextended/qtarget</a></td></tr><tr><td><code>ox_target</code></td><td><a href="https://github.com/overextended/ox_target">https://github.com/overextended/ox_target</a></td></tr></tbody></table>

{% hint style="info" %}
You can also change the way of interacting custom to your city by modifying the `InteractionLoop` function in `client/open.lua.`
{% endhint %}

## 3. General Settings

These are general settings that you see in most heist scripts. The comment next to it should explain it all.

```lua
cfg.police_required = 0 -- Minimum amount of police online required to start the heist.
cfg.bag_required = false -- Require a bag to rob
cfg.available_bags = {45,46} -- Allowed bags (Only necessary if cfg.bag_required is true)
cfg.police_jobs = { 'police', } -- Police jobs that get dispatch notifications and can optionally close the bank
cfg.police_close_command = {
    enabled = true, -- Enable police officers to close a bank after robbery. (After cooldown it will reset and close anyways)
    command = 'closefleeca' -- Command used to close a bank after robbery.
}
```

## 4. Cooldown

<pre class="language-lua"><code class="lang-lua"><strong>cfg.cooldown = {
</strong>    bank_cooldown = 30, -- Cooldown between robberies on the same bank in minutes
    global_cooldown = 15 -- Cooldown on all robbies in minutes, causes cooldown on all zevo scripts or scripts that use the event.
}
</code></pre>

## 5. Dispatch

When there is activity detected at the bank the police gets notified via a dispatch message. We have a built in standalone message or you can select an external dispatch script.

```lua
cfg.dispatch = {
    dispatch_script = 'standalone', -- Choose between core_dispatch, qs-dispatch, outlawalert, cd_dispatch, ps-dispatch or standalone	
    dispatch_code = '10-90', -- Dispatch code added to the message.
    message = 'Fleeca Bank Robbery', -- Dispatch message.
    color = 2, -- Blip Color, more info: https://docs.fivem.net/docs/game-references/blips/#blip-colors
    sprite = 500, -- Blip Sprite, more info: https://docs.fivem.net/docs/game-references/blips/#blips
    scale = 1.0, -- Blip Scale
    time = 300, -- Blip Seconds Visible in seconds.
    delay = 5, -- Dispatch delay after first interaction in seconds.
}
```

{% hint style="info" %}
You can customize the dispatch message in `client/open.lua.`
{% endhint %}

## 6. Discord Logs

Our logging system makes use of discord webhooks to send information about certain events. For more information about discord webhooks and how to set them up, check [this article](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks).

```lua
cfg.webhooks = {
    ['give_item'] = {
        webhook = '', -- Used when someone is rewarded an item
        username = 'Fleeca Bank Robbery',
        avatar = 'https://cdn.discordapp.com/icons/887069596794912779/00386af73da5a9b8ac978cfec42d1c79.webp?size=128',
    },
    ['start_heist'] = {
        webhook = '', -- Used when someone has started a heist
        username = 'Fleeca Bank Robbery',
        avatar = 'https://cdn.discordapp.com/icons/887069596794912779/00386af73da5a9b8ac978cfec42d1c79.webp?size=128',
    },
    ['reset_bank'] = {
        webhook = '', -- Used a bank has finished cooldown and reset
        username = 'Fleeca Bank Robbery',
        avatar = 'https://cdn.discordapp.com/icons/887069596794912779/00386af73da5a9b8ac978cfec42d1c79.webp?size=128',
    },
    ['ban_player'] = {
        webhook = '', -- Used when a player is caught executing an event
        username = 'Fleeca Bank Robbery',
        avatar = 'https://cdn.discordapp.com/icons/887069596794912779/00386af73da5a9b8ac978cfec42d1c79.webp?size=128',
    }
}
```

## 7. Robbery Interactions

We use a similar structure in all our heists to make it easy to configure and customize to your liking. You can change the minigame, evidence chance, required items and much more for every single interaction. You can even change it per bank so every bank has different rewards, minigames, etc.

### 7.1 Minigames

You can choose which minigames you would like your players to get. Check out the [minigames section](https://zevo-scripts.gitbook.io/home/minigames) to see all the available minigames and how to install them. You can also add them yourself in `client/open.lua` or request them in a ticket.

```lua
minigame = {
    name = 'none',
    data = {},
},
```

### 7.2  Doors

The doors array shows which indices of `cfg.doors` are opened upon completion of the interaction.

```lua
doors = {1,2,3},
```

### 7.3 Locked Until

The locked until array shows which indices of `cfg.interactables` need to be completed before the interaction becomes available.

```lua
locked_until = {1,2,3},
```

### 7.4 Evidence

You can configure the chance evidence is left behind on every interaction.

```lua
evidence_chance = 100,
```

{% hint style="info" %}
By default only QBCore and QBox have an evidence system. You can add your custom evidence system in `client/open.lua`
{% endhint %}

### 7.5 Interaction/Target

```lua
interaction_text = '[E] TEXT',  -- Interaction text if using qb-drawtext or HelpInteraction
interaction_distance = 1.5, -- Minimum distance to interact
interaction_key = 38, -- Interaction button check: https://docs.fivem.net/docs/game-references/controls/

target = {
    pos = vec3(0.0, 0.0, 0.0), -- don't touch
    icon = 'fas fa-box-dollar', -- interaction icon, check fontawesome for alternatives: https://fontawesome.com/
    targeticon = nil, -- Interaction/Target icon, only available for qb-target, leave nil for default eye
    text = 'TEXT', -- Interaction text if using qtarget or qb-target
    lenght = 0.7, -- don't touch
    width = 3.0, -- don't touch
    height = 1.0, -- don't touch
}
```

### 7.6 Required Items

You can configure which items are required per interaction. You can require multiple items or even no items at all by changing `item = nil` or removing the whole `required_items` array.

<pre class="language-lua"><code class="lang-lua"><strong>required_items =  { -- Item required to start interaction
</strong>    { item = 'REQUIRED ITEM', amount = 1, remove_amount = 1, remove_chance = 100 },
    { item = 'SECOND ITEM', amount = 3, remove_amount = 3, remove_chance = 50 },
},
</code></pre>

### 7.7 Rewards

The configuration of rewards can be different per interaction type, we will go over the ones used in this script. The following items/rewards will be a bit different.\
\
`'money'` will be given as cash instead of as item\
`'black_money'` will be given as black money instead of as item on ESX\
`'markedbills'` will be given as item with the worth as metadata on QBCore, you can configure the worth in config.\
\
if you wish to modify any of this, you can in `server/open.lua`

#### 7.7.1 Trolly

A trolly can spawn as 3 different types: gold, diamond and cash. These are represented by the `grab_type`, they can not be renamed or changed. You can delete the rows of types you don't want spawned. For example, if you don't want the diamond type to spawn, you can just delete that line.

```lua
types = { -- don't touch grab_types. You can delete rows you don't want, increase/decrease the spawn chances, change item rewards
    {grab_type = 'gold',    reward = 'goldbar', reward_amount = {10, 25},  chance = 33},
    {grab_type = 'diamond', reward = 'diamondbar', reward_amount = {25, 100}, chance = 33},
    {grab_type = 'cash',    reward = 'money',   reward_amount = {1, 3}, chance = 33},
},
```

The probability of spawning a particular type is based on the total chance in the array, in this case 99. You can adjust the total probability in the array. They don't have to add up to 100, you can use 1 and 2, for example, giving double the chance to a particular type. it functions as a weighted luck system.

#### 7.7.2 Pile

A pile can spawn as 2 different types: gold and cash. These are represented by the `grab_type`, they can not be renamed or changed. The rest works the same as the trolly types.

```lua
types = { -- don't touch grab_types. You can delete rows you don't want, increase/decrease the spawn chances, change item rewards
    {grab_type = 'gold', reward = 'goldbar', reward_amount = {10, 25},  chance = 50},
    {grab_type = 'cash', reward = 'money',   reward_amount = {1, 3}, chance = 50},
},
```

#### 7.7.3 Painting

A painting can spawn as 10 different types. These are represented by the `grab_type`, they can not be renamed or changed. The rest works the same as the trolly types.

```lua
types = { -- don't touch grab_types. You can delete rows you don't want, increase/decrease the spawn chances, change item rewards
    {grab_type = 'a', reward = 'painting_a', reward_amount = {1, 1},  chance = 10},
    {grab_type = 'b', reward = 'painting_b', reward_amount = {1, 1}, chance = 10}, 
    {grab_type = 'c', reward = 'painting_c', reward_amount = {1, 1}, chance = 10},
    {grab_type = 'd', reward = 'painting_d', reward_amount = {1, 1}, chance = 10},
    {grab_type = 'e', reward = 'painting_e', reward_amount = {1, 1}, chance = 10},
    {grab_type = 'f', reward = 'painting_f', reward_amount = {1, 1},  chance = 10},
    {grab_type = 'g', reward = 'painting_g', reward_amount = {1, 1}, chance = 10}, 
    {grab_type = 'h', reward = 'painting_h', reward_amount = {1, 1}, chance = 10},
    {grab_type = 'i', reward = 'painting_i', reward_amount = {1, 1}, chance = 10},
    {grab_type = 'j', reward = 'painting_j', reward_amount = {1, 1}, chance = 10},
},
```

#### 7.7.4 Display

A display can spawn as 5 different types. These are represented by the `grab_type`, they can not be renamed or changed. The rest works the same as the trolly types.

```lua
types = { -- don't touch grab_types. You can delete rows you don't want, increase/decrease the spawn chances, change item rewards
    {grab_type = 'diamond', reward = 'diamond', reward_amount = {1, 1},  chance = 20},
    {grab_type = 'necklace', reward = 'ruby_necklace', reward_amount = {1, 1}, chance = 20}, 
    {grab_type = 'panther', reward = 'panther', reward_amount = {1, 1}, chance = 20},
    {grab_type = 'bottle', reward = 'tequila_bottle', reward_amount = {1, 1}, chance = 20},
    {grab_type = 'pogo', reward = 'pogo', reward_amount = {1, 1}, chance = 20},
},
```
