# MARKET ROBBERY

***

### 1) Overview

Risk Market Robbery is a dynamic store robbery system for FiveM servers featuring:

* 🏪 21 pre-configured robbery locations across the map
* ⏱️ Time-based robbery mechanics with progress tracking
* 👮 Police notification system with GPS alerts
* 💰 Configurable reward system (cash, black money, or items)
* 🔒 Item/weapon requirements for robberies
* 🌍 Multi-language support (6 languages included)
* 📊 Discord webhook integration
* 🎨 Fully customizable UI themes

***

### 2) Basic Configuration

#### Framework Detection

```lua
Config.Framework = nil
```

**Leave as `nil`** — The script automatically detects ESX, QBCore, or QBox

#### Language Selection

```lua
Config.Locale = 'en'
```

**Available languages:** `'de'`, `'en'`, `'pl'`, `'fr'`, `'pt'`, `'es'`

#### Notification System

```lua
Config.UseCustomNotify = false
Config.UseCustomHelpNotify = false

Config.Functions = {
    ["notify"] = function(ntype, title, text, time)
        exports['risk-notify']:Notify({
            type = ntype or 'info',
            message = text,
            title = title or 'MARKET ROBBERY',
            duration = time or 10000
        })
    end,
    ["helpnotify"] = function(key, text)
        exports["risk-notify"]:HelpNotify(key, text)
    end,
}
```

**To use default notifications:**

```lua
Config.UseCustomNotify = false
Config.UseCustomHelpNotify = false
```

**To integrate other notification systems:**

```lua
Config.UseCustomNotify = true

Config.Functions = {
    ["notify"] = function(ntype, title, text, time)
        -- Example: ox_lib
        lib.notify({
            title = title,
            description = text,
            type = ntype
        })
        
        -- Example: mythic_notify
        -- exports['mythic_notify']:DoHudText(ntype, text)
        
        -- Example: t-notify
        -- exports['t-notify']:Custom({
        --     style = ntype,
        --     message = text,
        --     duration = time
        -- })
    end,
}
```

***

### 3) Robbery Settings

#### Core Mechanics

```lua
Config.RobTime = 900
Config.MinPolice = 1
Config.PoliceJobs = {'police', 'sheriff'}
Config.Cooldown = 600
```

**Configuration details:**

* **RobTime:** Duration in seconds (900 = 15 minutes)
* **MinPolice:** Minimum police officers required to start robbery
* **PoliceJobs:** Job names that count as police
* **Cooldown:** Time before store can be robbed again (600 = 10 minutes)

**Time conversion reference:**

```lua
-- 5 minutes = 300 seconds
-- 10 minutes = 600 seconds
-- 15 minutes = 900 seconds
-- 20 minutes = 1200 seconds
-- 30 minutes = 1800 seconds
```

#### Reward System

```lua
Config.RewardType = 'cash'
Config.RewardItem = 'black_money'
```

**RewardType options:**

* `'cash'` — Gives cash money
* `'black_money'` — Gives black/dirty money
* `'item'` — Gives item (specify in `Config.RewardItem`)

#### Global Limits

```lua
Config.MaxSimultaneousRobberies = 3
Config.UseStreetNames = true
```

* **MaxSimultaneousRobberies:** Maximum concurrent robberies server-wide
* **UseStreetNames:** Display street names in notifications and webhooks

#### Distance Settings

```lua
Config.InteractionKey = 38
Config.InteractionDistance = 2.5
Config.MarkerDistance = 10.0
Config.MaxDistance = 15.0
```

* **InteractionKey:** Key to interact (38 = E) — [Key Codes](https://docs.fivem.net/docs/game-references/controls/)
* **InteractionDistance:** Distance to show "Press E" prompt
* **MarkerDistance:** Distance to render 3D markers
* **MaxDistance:** Maximum distance before robbery auto-cancels

***

### 4) Requirements System

#### Item Requirements

```lua
Config.RequireItem = false
Config.RemoveItemOnUse = false
Config.RemoveItemAmount = 1

Config.RequiredItems = {
    {item = 'bread', label = 'Dietrich'},
    {item = 'weapon_pistol', label = 'Pistole (Item)'},
    {item = 'advancedlockpick', label = 'Advanced Lockpick'}
}
```

**How it works:**

* **RequireItem:** Player must have one of the listed items
* **RemoveItemOnUse:** Remove item when starting robbery
* **RemoveItemAmount:** How many items to remove

**Example configurations:**

**No requirements:**

```lua
Config.RequireItem = false
Config.RequireWeapon = false
```

**Require lockpick (consumed):**

```lua
Config.RequireItem = true
Config.RemoveItemOnUse = true
Config.RemoveItemAmount = 1
Config.RequiredItems = {
    {item = 'lockpick', label = 'Lockpick'},
}
```

**Require lockpick (not consumed):**

```lua
Config.RequireItem = true
Config.RemoveItemOnUse = false
Config.RequiredItems = {
    {item = 'lockpick', label = 'Lockpick'},
}
```

**Multiple accepted items:**

```lua
Config.RequiredItems = {
    {item = 'lockpick', label = 'Basic Lockpick'},
    {item = 'advancedlockpick', label = 'Advanced Lockpick'},
    {item = 'electroniclockpick', label = 'Electronic Lockpick'}
}
```

#### Weapon Requirements

```lua
Config.RequireWeapon = false

Config.RequiredWeapons = {
    {weapon = 'WEAPON_PISTOL', label = 'Pistole'},
    {weapon = 'WEAPON_COMBATPISTOL', label = 'Combat Pistol'},
    {weapon = 'WEAPON_APPISTOL', label = 'AP Pistol'},
}
```

**How it works:**

* Player must have one of the listed weapons **equipped** (in hand)
* Weapons are **NOT** consumed
* Weapon must be actively held to start robbery

**Common weapon hashes:**

```lua
-- Pistols
{weapon = 'WEAPON_PISTOL', label = 'Pistol'},
{weapon = 'WEAPON_COMBATPISTOL', label = 'Combat Pistol'},
{weapon = 'WEAPON_PISTOL50', label = 'Pistol .50'},

-- SMGs
{weapon = 'WEAPON_MICROSMG', label = 'Micro SMG'},
{weapon = 'WEAPON_SMG', label = 'SMG'},

-- Shotguns
{weapon = 'WEAPON_PUMPSHOTGUN', label = 'Pump Shotgun'},
{weapon = 'WEAPON_SAWNOFFSHOTGUN', label = 'Sawn-off Shotgun'},

-- Rifles
{weapon = 'WEAPON_ASSAULTRIFLE', label = 'Assault Rifle'},
{weapon = 'WEAPON_CARBINERIFLE', label = 'Carbine Rifle'},
```

***

### 5) Visual Configuration

#### Map Blips

```lua
Config.UseBlips = true

Config.BlipSettings = {
    sprite = 849,
    color = 1,
    scale = 0.5,
    name = 'Market Robbery'
}
```

**Blip customization:**

* **sprite:** Icon type — [Blip Sprites](https://docs.fivem.net/docs/game-references/blips/)
* **color:** Color ID (1 = red, 2 = green, 3 = blue, etc.)
* **scale:** Size of blip
* **name:** Text displayed on map

**Popular blip sprites:**

```lua
sprite = 52   -- Convenience store
sprite = 156  -- Skull (danger)
sprite = 161  -- Police alert
sprite = 487  -- Dollar sign
sprite = 849  -- Store robbery
```

#### 3D Markers

```lua
Config.UseMarker = true
Config.MarkerType = 1
Config.MarkerColor = {r = 255, g = 0, b = 0, a = 100}
Config.MarkerSize = {x = 1.0, y = 1.0, z = 1.0}
```

**Marker types:**

* `1` — Cylinder (recommended)
* `2` — Sphere
* `20` — Circle
* `27` — Outline [Full Marker List](https://docs.fivem.net/docs/game-references/markers/)

**Color examples:**

```lua
-- Red
Config.MarkerColor = {r = 255, g = 0, b = 0, a = 100}

-- Yellow
Config.MarkerColor = {r = 255, g = 255, b = 0, a = 100}

-- Green
Config.MarkerColor = {r = 0, g = 255, b = 0, a = 100}

-- Blue
Config.MarkerColor = {r = 0, g = 0, b = 255, a = 100}
```

#### Robbery Radius Marker

```lua
Config.ShowRobberyRadiusMarker = true
Config.RadiusMarkerType = 1
Config.RadiusMarkerColor = {r = 255, g = 255, b = 0, a = 170}
```

Shows players the maximum distance they can move during robbery (visual boundary)

#### NPCs (Optional)

```lua
Config.UseNPC = false
Config.NPCModel = 'a_m_m_indian_01'
```

**Popular NPC models:**

```lua
'a_m_m_indian_01'       -- Indian male
's_m_m_highsec_01'      -- Security guard
'cs_priest'             -- Priest
'a_f_y_business_01'     -- Business female
'mp_m_shopkeep_01'      -- Shopkeeper
```

#### Props/Objects (Optional)

```lua
Config.UseProp = false
Config.PropModel = 'prop_cash_trolly'
```

**Common prop models:**

```lua
'prop_cash_trolly'      -- Cash trolley
'prop_money_bag_01'     -- Money bag
'prop_atm_01'           -- ATM machine
'v_ret_gc_cashreg'      -- Cash register
```

***

### 6) Police System

#### Police Configuration

```lua
Config.MinPolice = 1
Config.PoliceJobs = {'police', 'sheriff'}
```

**How it works:**

1. System counts online players with police jobs
2. Robbery can only start if `MinPolice` requirement is met
3. All police receive GPS alert when robbery starts
4. Police get notification if robbery is cancelled

**Example configurations:**

**Low population server:**

```lua
Config.MinPolice = 0  -- No police required
```

**Medium server:**

```lua
Config.MinPolice = 2
Config.PoliceJobs = {'police', 'sheriff'}
```

**High population server:**

```lua
Config.MinPolice = 5
Config.PoliceJobs = {'police', 'sheriff', 'state', 'swat'}
```

#### Police Alerts

Police automatically receive:

* 🚨 In-game notification with street name
* 📍 GPS blip on map (lasts 60 seconds)
* 🔔 Cancellation notification if robbery is aborted

***

### 7) Robbery Locations

Each location has coordinates and reward range:

```lua
Config.Locations = {
    {
        coords = vector4(366.3563, -1573.7852, 29.2346, 123.3710),
        rewards = {min = 2500, max = 11000}
    },
    {
        coords = vector4(-708.8940, -904.8651, 19.2156, 187.3125),
        rewards = {min = 3200, max = 13500}
    },
    -- 21 total locations...
}
```

**Reward balancing tips:**

* Downtown locations: Lower rewards (easier police response)
* Remote locations: Higher rewards (harder police response)
* Balance based on your economy

**Example reward ranges:**

```lua
-- Low risk (city center)
rewards = {min = 2000, max = 8000}

-- Medium risk (suburbs)
rewards = {min = 5000, max = 15000}

-- High risk (remote areas)
rewards = {min = 10000, max = 30000}
```

**To add a new location:**

```lua
table.insert(Config.Locations, {
    coords = vector4(x, y, z, heading),  -- Get coords in-game with /getcoords
    rewards = {min = 5000, max = 15000}
})
```

**To remove a location:** Simply delete or comment out the entry:

```lua
-- {
--     coords = vector4(366.3563, -1573.7852, 29.2346, 123.3710),
--     rewards = {min = 2500, max = 11000}
-- },
```

***

### 8) Localization System

#### Selecting Language

```lua
Config.Locale = 'en'
```

**Available languages:**

* `'de'` — German
* `'en'` — English
* `'pl'` — Polish
* `'fr'` — French
* `'pt'` — Portuguese
* `'es'` — Spanish

#### Adding Custom Language

In `locales.lua`, add your language:

```lua
Locales['it'] = {  -- Italian example
    ['ui_title'] = 'GRAND THEFT:RETAIL',
    ['ui_description'] = 'Rapina il negozio prima che scada il tempo!',
    ['ui_robbery_progress'] = 'SVUOTAMENTO IN CORSO...',
    ['ui_potential_loot'] = 'BOTTINO POTENZIALE',
    ['ui_withdraw'] = 'PRENDI I SOLDI',
    ['ui_start_robbery'] = 'INIZIA',
    ['ui_rob_this_store'] = 'RAPINA QUESTO NEGOZIO',
    ['ui_robbery_complete'] = 'RAPINA COMPLETATA',
    
    ['notify_not_enough_police'] = 'Non abbastanza polizia in servizio!',
    ['notify_store_cooldown'] = 'Negozio rapinato di recente! Aspetta %s.',
    ['notify_success'] = 'Hai rubato $%s!',
    ['notify_too_far'] = 'Troppo lontano! Rapina annullata.',
    ['notify_already_robbing'] = 'Negozio già sotto rapina!',
    ['notify_max_robberies'] = 'Troppe rapine in corso!',
    
    ['notify_police_alert'] = 'Rapina in corso! Controlla GPS!',
    ['notify_police_alert_location'] = 'Rapina a %s! Controlla GPS!',
    ['notify_police_cancelled'] = 'Rapina annullata!',
    ['notify_police_cancelled_location'] = 'Rapina a %s annullata!',
    
    ['notify_missing_item'] = 'Ti serve uno di questi oggetti: %s',
    ['notify_missing_weapon'] = 'Ti serve una di queste armi: %s',
    
    ['help_rob_store'] = 'Premi E per rapinare',
    ['police_alert'] = 'Rapina',
    ['police_notification_title'] = 'ALLARME POLIZIA',
    
    ['time_minutes'] = '%smin',
    ['time_minutes_seconds'] = '%smin %ssec',
    ['time_seconds'] = '%ssec'
}
```

Then set:

```lua
Config.Locale = 'it'
```

#### Customizing Existing Strings

Edit any string in `locales.lua`:

```lua
Locales['en'] = {
    ['ui_title'] = 'STORE HEIST',  -- Changed from GRAND THEFT:RETAIL
    ['notify_success'] = 'You stole $%s from the register!',  -- More detailed
    -- ...
}
```

***

### 9) Discord Webhooks

#### Basic Setup

```lua
WebhookConfig.UseWebhook = true
WebhookConfig.DiscordWebhook = 'https://discord.com/api/webhooks/YOUR_WEBHOOK_URL'
```

**To get a webhook URL:**

1. Open Discord server settings
2. Go to "Integrations" → "Webhooks"
3. Click "New Webhook"
4. Copy webhook URL
5. Paste into config

#### Bot Appearance

```lua
WebhookConfig.BotName = 'Market Robbery System'
WebhookConfig.BotAvatar = 'https://i.imgur.com/your-image.png'
```

**Avatar tips:**

* Use 512x512 px image
* Upload to Imgur or similar
* Use direct image link (.png, .jpg)

#### Embed Colors

```lua
WebhookConfig.Colors = {
    started = 16776960,    -- Yellow
    cancelled = 15158332,  -- Red
    completed = 3066993    -- Green
}
```

**Color conversion:** Use [SpyColor](https://www.spycolor.com/) to convert HEX to decimal

**Popular colors:**

```lua
-- Status colors
started = 16776960      -- Yellow (#FFFF00)
cancelled = 15158332    -- Red (#E74C3C)
completed = 3066993     -- Green (#2ECC71)

-- Custom colors
blue = 3447003          -- Blue (#3498DB)
purple = 10181046       -- Purple (#9B59B6)
orange = 15105570       -- Orange (#E67E22)
```

#### Footer Customization

```lua
WebhookConfig.Footer = {
    text = 'Risk Scripts | Market Robbery',
    icon_url = 'https://i.imgur.com/your-footer-icon.png'
}
```

#### Webhook Messages

Each webhook type has customizable fields:

```lua
WebhookConfig.Messages = {
    started = {
        title = '🚨 Robbery Started',
        description = 'A store robbery has been initiated!',
        fields = {
            player = '👤 Player',
            identifier = '🆔 Identifier',
            location = '📍 Location',
            coordinates = '🗺️ Coordinates',
            time = '🕐 Time'
        }
    },
    
    completed = {
        title = '✅ Robbery Completed & Money Collected',
        description = 'Successfully completed!',
        fields = {
            player = '👤 Player',
            identifier = '🆔 Identifier',
            location = '📍 Location',
            coordinates = '🗺️ Coordinates',
            amount = '💰 Amount Stolen',
            time = '🕐 Time'
        }
    },
    
    cancelled = {
        title = '❌ Robbery Cancelled',
        description = 'Robbery was cancelled!',
        fields = {
            player = '👤 Player',
            identifier = '🆔 Identifier',
            location = '📍 Location',
            coordinates = '🗺️ Coordinates',
            reason = '📋 Reason',
            time = '🕐 Time'
        },
        reasons = {
            too_far = 'Player moved too far away',
            disconnect = 'Player disconnected'
        }
    }
}
```

**To disable specific webhook types:**

```lua
-- Disable started webhooks (only log completed/cancelled)
WebhookConfig.Messages.started = nil
```

***

### 10) UI Theming

Customize colors in `html/config.css`:

```css
:root {
    --main-color-1: #FFFF00;   /* Primary color */
    --main-color-2: #CCCC00;   /* Secondary color */
    --main-color-3: #999900;   /* Tertiary color */
    --ui-scale: 1.3;           /* UI size multiplier */
}
```

#### Theme Examples

**Red Theme (Dangerous):**

```css
:root {
    --main-color-1: #FF0000;
    --main-color-2: #CC0000;
    --main-color-3: #990000;
    --ui-scale: 1.3;
}
```

**Blue Theme (Professional):**

```css
:root {
    --main-color-1: #00B4FF;
    --main-color-2: #0090CC;
    --main-color-3: #006C99;
    --ui-scale: 1.3;
}
```

**Green Theme (Money):**

```css
:root {
    --main-color-1: #00FF00;
    --main-color-2: #00CC00;
    --main-color-3: #009900;
    --ui-scale: 1.3;
}
```

**Purple Theme (Elite):**

```css
:root {
    --main-color-1: #9B59B6;
    --main-color-2: #8E44AD;
    --main-color-3: #6C3483;
    --ui-scale: 1.3;
}
```

**Orange Theme (Action):**

```css
:root {
    --main-color-1: #FF8C00;
    --main-color-2: #CC7000;
    --main-color-3: #995400;
    --ui-scale: 1.3;
}
```

#### UI Scaling

```css
--ui-scale: 1.0;   /* Small (100%) */
--ui-scale: 1.3;   /* Default (130%) */
--ui-scale: 1.5;   /* Large (150%) */
--ui-scale: 1.8;   /* Extra Large (180%) */
```

***

### 11) Complete Configuration Examples

#### Example 1: Casual Server (Easy Robberies)

```lua
-- Low requirements, high rewards, no police
Config.RobTime = 300                    -- 5 minutes
Config.MinPolice = 0                    -- No police required
Config.Cooldown = 300                   -- 5 minute cooldown
Config.RequireItem = false              -- No items needed
Config.RequireWeapon = false            -- No weapons needed
Config.MaxSimultaneousRobberies = 10    -- Many robberies allowed

Config.RewardType = 'cash'

-- Increase all rewards by 50%
for _, location in ipairs(Config.Locations) do
    location.rewards.min = location.rewards.min * 1.5
    location.rewards.max = location.rewards.max * 1.5
end
```

#### Example 2: Serious RP Server (Realistic)

```lua
-- High requirements, balanced rewards, police needed
Config.RobTime = 900                    -- 15 minutes
Config.MinPolice = 3                    -- 3 police required
Config.Cooldown = 1800                  -- 30 minute cooldown
Config.MaxSimultaneousRobberies = 2     -- Max 2 robberies

Config.RequireItem = true
Config.RemoveItemOnUse = true
Config.RequiredItems = {
    {item = 'advancedlockpick', label = 'Advanced Lockpick'}
}

Config.RequireWeapon = true
Config.RequiredWeapons = {
    {weapon = 'WEAPON_PISTOL', label = 'Pistol'},
    {weapon = 'WEAPON_COMBATPISTOL', label = 'Combat Pistol'}
}

Config.RewardType = 'black_money'
```

#### Example 3: Hardcore Server (Very Difficult)

```lua
-- Very high requirements, low rewards, challenging
Config.RobTime = 1200                   -- 20 minutes
Config.MinPolice = 5                    -- 5 police required
Config.Cooldown = 3600                  -- 1 hour cooldown
Config.MaxSimultaneousRobberies = 1     -- Only 1 robbery at a time
Config.MaxDistance = 10.0               -- Tighter radius

Config.RequireItem = true
Config.RemoveItemOnUse = true
Config.RequireWeapon = true

Config.RewardType = 'item'
Config.RewardItem = 'black_money'

-- Reduce all rewards by 50%
for _, location in ipairs(Config.Locations) do
    location.rewards.min = location.rewards.min * 0.5
    location.rewards.max = location.rewards.max * 0.5
end
```

#### Example 4: PvP Server (Fast & Dangerous)

```lua
-- Fast robberies, high rewards, no cooldowns
Config.RobTime = 180                    -- 3 minutes
Config.MinPolice = 0                    -- No police requirement
Config.Cooldown = 0                     -- No cooldown
Config.MaxSimultaneousRobberies = 20    -- Unlimited robberies

Config.RequireItem = false
Config.RequireWeapon = true             -- Must have weapon
Config.RequiredWeapons = {
    {weapon = 'WEAPON_PISTOL', label = 'Any Gun'}
}

Config.RewardType = 'cash'

-- Double all rewards
for _, location in ipairs(Config.Locations) do
    location.rewards.min = location.rewards.min * 2
    location.rewards.max = location.rewards.max * 2
end
```

***

### 12) Troubleshooting

#### ❌ "Not enough cops on duty!"

**Cause:** Less than `Config.MinPolice` officers online\
**Solution:**

* Lower `Config.MinPolice`
* Add more jobs to `Config.PoliceJobs`
* Set to 0 for testing

#### ❌ "Store recently robbed! Wait X minutes"

**Cause:** Store is on cooldown\
**Solution:**

* Lower `Config.Cooldown`
* Restart resource to reset cooldowns
* Rob a different location

#### ❌ "You need one of these items: X"

**Cause:** `Config.RequireItem = true` but player doesn't have item\
**Solution:**

* Give item: `/giveitem [id] lockpick 1`
* Set `Config.RequireItem = false`
* Add more items to `Config.RequiredItems`

#### ❌ "You need one of these weapons: X"

**Cause:** `Config.RequireWeapon = true` but weapon not equipped\
**Solution:**

* Give weapon and **equip it** (hold in hand)
* Set `Config.RequireWeapon = false`
* Add more weapons to `Config.RequiredWeapons`

#### ❌ "Too many robberies in progress!"

**Cause:** `MaxSimultaneousRobberies` limit reached\
**Solution:**

* Increase `Config.MaxSimultaneousRobberies`
* Wait for other robberies to complete
* Default is 3, increase to 5-10 for busy servers

#### ❌ "Too far away! Robbery cancelled"

**Cause:** Player left `Config.MaxDistance` radius\
**Solution:**

* Increase `Config.MaxDistance`
* Stay closer to robbery location
* Consider disabling: `Config.ShowRobberyRadiusMarker = false`

#### ❌ UI won't open

**Possible causes:**

* Too far from location
* Another player robbing same store
* Item/weapon requirement not met

**Solution:**

* Stand very close to marker
* Check console for errors (F8)
* Verify requirements are met

#### ❌ No police notifications

**Possible causes:**

* No players with police jobs online
* Wrong job names in `Config.PoliceJobs`

**Solution:**

* Verify job names match your framework
* Add missing jobs to config

#### ❌ Rewards not given

**Possible causes:**

* `Config.RewardType` mismatch
* Framework not detected
* `Config.RewardItem` doesn't exist

**Solution:**

* Check `Config.RewardType` setting
* Verify framework is running
* Test with `'cash'` first

#### ❌ Discord webhooks not sending

**Possible causes:**

* Invalid webhook URL
* `WebhookConfig.UseWebhook = false`
* Webhook deleted from Discord

**Solution:**

* Create new webhook in Discord
* Copy full URL with token
* Set `WebhookConfig.UseWebhook = true`

#### ❌ Blips/markers not showing

**Possible causes:**

* `Config.UseBlips = false`
* `Config.UseMarker = false`
* Too far from locations

**Solution:**

* Set both to `true`
* Approach robbery locations
* Restart resource: `/restart risk-marketrobbery`

***

### 13) Best Practices

✅ **Balance robbery time with police count** — Longer robberies need more police\
✅ **Test different reward ranges** — Adjust based on your economy\
✅ **Use cooldowns on high-reward locations** — Prevent farming\
✅ **Consider item consumption** — Makes robberies more costly\
✅ **Place NPCs/props carefully** — Avoid traffic or busy areas\
✅ **Test police alerts** — Verify GPS blips appear correctly\
✅ **Use street names** — Helps police respond faster\
✅ **Customize for server type** — RP vs PvP need different settings\
✅ **Monitor Discord webhooks** — Track patterns and adjust\
✅ **Regular config reviews** — Update based on player feedback

***

### 14) Performance Tips

⚡ **Disable unused features:**

```lua
Config.UseNPC = false      -- NPCs reduce performance
Config.UseProp = false     -- Props add entities
Config.UseMarker = false   -- Use blips only
```

⚡ **Increase distances carefully:**

```lua
Config.MarkerDistance = 10.0   -- Don't set too high
Config.MaxDistance = 15.0      -- Keep reasonable
```

⚡ **Optimize webhook calls:**

```lua
WebhookConfig.UseWebhook = false  -- Disable if not needed
```

***

### 15) Quick Start Checklist

* \[ ] Select language: `Config.Locale`
* \[ ] Set robbery duration: `Config.RobTime`
* \[ ] Configure police requirements: `Config.MinPolice`, `Config.PoliceJobs`
* \[ ] Set cooldown: `Config.Cooldown`
* \[ ] Choose reward type: `Config.RewardType`
* \[ ] Configure requirements: `Config.RequireItem`, `Config.RequireWeapon`
* \[ ] Adjust reward amounts in `Config.Locations`
* \[ ] Set up Discord webhooks (optional)
* \[ ] Customize UI colors in `config.css`
* \[ ] Test with 2 players (one criminal, one cop)
* \[ ] Restart resource: `/restart risk-marketrobbery`

***

### 16) How It Works

#### Robbery Flow

1. **Player approaches location** → Sees marker/blip
2. **Presses E** → Checks requirements and police count
3. **UI opens** → Player clicks "START ROBBERY"
4. **Timer starts** → Police receive GPS alert
5. **Player stays in radius** → Progress bar runs
6. **Timer completes** → Reward is calculated
7. **Player clicks "GRAB CASH"** → Money added to account
8. **Location goes on cooldown** → Can't be robbed again for X minutes

#### Security Features

* ✅ Server-side validation for all actions
* ✅ Distance checks prevent teleport exploits
* ✅ Cooldown system prevents spam
* ✅ Police count verified on start
* ✅ Item/weapon checks server-side
* ✅ Reward amounts stored server-side (not in NUI)
* ✅ Player disconnect handling

***


---

# 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://risk-scripts.gitbook.io/risk-scripts/scripts/market-robbery.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.
