# Configuration

The resource is highly configurable via `config.lua`.

### Framework & Interaction

The script attempts to auto-detect your framework and interaction scripts. You can force specific systems if auto-detection fails.

```lua
Config.Framework = 'auto' -- Options: 'auto', 'esx', 'qbcore'
Config.Target = 'auto'    -- Options: 'auto', 'ox_target', 'qb-target', 'textui'
Config.Notify = 'auto'    -- Options: 'auto', 'ox_lib', 'okokNotify', 'native'
```

### Gameplay Settings

* **Config.Debug**: Set to `true` to enable debug prints and markers.
* **Config.Levels**: Adjust XP requirements and titles for each level.
* **Config.Missions**: Configure mission cooldowns and daily limits.
* **Config.MetalDetector**: Tune detection range and digging speeds.

#### config.lua

```lua
--[[
  ___ __  __ ___  ___ ___ ___ _   _ __  __    ___  ___ ___ ___ ___ _____ ___ 
 |_ _|  \/  | _ \| __| _ \_ _| | | |  \/  |  / __|/ __| _ \_ _| _ \_   _/ __|
  | || |\/| |  _/| _||   /| || |_| | |\/| |  \__ \ (__|   /| ||  _/ | | \__ \
 |___|_|  |_|_|  |___|_|_\___|\___/|_|  |_|  |___/\___|_|_\___|_|   |_| |___/
                                                                           
  TEBEX   : https://imperium-scripts.tebex.io
  GITBOOK : https://imperiumscripts.gitbook.io/imperium-scripts/
  DISCORD : https://discord.gg/u5TxHBjQdS
--]]

Config = {}

-- ============================================================================
-- CORE SETTINGS
-- ============================================================================
Config.Debug = false                          -- Enable debug prints
Config.Locale = 'en'                          -- en, fr, de, es, pt, tr 

-- ============================================================================
-- FRAMEWORK & DEPENDENCIES (auto-detection recommended)
-- ============================================================================
Config.Framework = 'auto'                     -- 'auto', 'esx', 'qbcore'
Config.Target = 'auto'                        -- 'auto', 'ox_target', 'qb-target', 'textui'
Config.Inventory = 'auto'                     -- 'auto', 'ox_inventory', 'qb-inventory', 'esx_inventory'
Config.Notify = 'auto'                        -- 'auto', 'ox_lib', 'okokNotify', 'native'

-- ============================================================================
-- NPC CONFIGURATION
-- ============================================================================
Config.NPCs = {
    JobGiver = {
        model = 's_m_y_baywatch_01',          -- Lifeguard model
        coords = vector4(-1467.27, -1387.83, 4.14, 196.31),
        scenario = 'WORLD_HUMAN_CLIPBOARD',
        blip = {
            enabled = true,
            sprite = 478,
            color = 1,                        -- Red
            scale = 0.8,
            label = 'Beach Cleanup Job'
        }
    },
    ShopKeeper = {
        model = 's_m_y_baywatch_01',
        coords = vector4(-1462.46, -1389.58, 4.14, 112.07) ,
        scenario = 'WORLD_HUMAN_STAND_IMPATIENT',
        blip = {
            enabled = false,
            sprite = 59,
            color = 2,                        -- Green
            scale = 0.7,
            label = 'Beach Shop'
        }
    }
}

-- ============================================================================
-- LEVEL SYSTEM
-- ============================================================================
Config.Levels = {
    [1] = { xpRequired = 0,     title = 'Rookie Collector' },
    [2] = { xpRequired = 500,   title = 'Beach Cleaner' },
    [3] = { xpRequired = 1500,  title = 'Environmental Guardian' },
    [4] = { xpRequired = 3500,  title = 'Treasure Seeker' },
    [5] = { xpRequired = 7000,  title = 'Master Scavenger' },
    [6] = { xpRequired = 12000, title = 'Beach Legend' }
}

Config.MetalDetectorUnlockLevel = 3           -- Level required to purchase metal detector

-- ============================================================================
-- MISSION CONFIGURATION
-- ============================================================================
Config.Missions = {
    Daily = {
        resetTime = '00:00',                  -- Server time for daily reset (HH:MM)
        maxPerDay = 3,                        -- Max daily missions per player
        cooldownMinutes = 0                   -- No cooldown for daily (reset-based)
    },
    Basic = {
        cooldownMinutes = 5,                  -- Cooldown between basic missions
        unlimited = true                      -- Can repeat infinitely
    }
}

-- Mission Templates
Config.MissionTemplates = {
    -- ========================================================================
    -- BASIC MISSIONS (Level 1-2) - Visible trash only
    -- ========================================================================
    Basic = {
        {
            id = 'basic_trash_1',
            name = 'Beach Cleanup',
            description = 'Collect trash scattered across the beach.',
            minLevel = 1,
            requirements = {
                { item = 'beach_trash', amount = 5 }
            },
            rewards = {
                money = 150,
                xp = 50
            }
        },
        {
            id = 'basic_trash_2',
            name = 'Plastic Patrol',
            description = 'Help clean up plastic waste from the shoreline.',
            minLevel = 1,
            requirements = {
                { item = 'beach_plastic', amount = 8 }
            },
            rewards = {
                money = 200,
                xp = 75
            }
        },
        {
            id = 'basic_trash_3',
            name = 'Glass Guardian',
            description = 'Remove dangerous glass bottles from the sand.',
            minLevel = 2,
            requirements = {
                { item = 'beach_glass', amount = 6 }
            },
            rewards = {
                money = 250,
                xp = 100
            }
        }
    },
    
    -- ========================================================================
    -- ADVANCED MISSIONS (Level 3+) - Requires Metal Detector
    -- ========================================================================
    Advanced = {
        {
            id = 'adv_treasure_1',
            name = 'Lost Treasures',
            description = 'Use your metal detector to find buried valuables.',
            minLevel = 3,
            requirements = {
                { item = 'metal_beach_scrap', amount = 3 },
                { item = 'beach_trash', amount = 3 }
            },
            rewards = {
                money = 500,
                xp = 200
            }
        },
        {
            id = 'adv_treasure_2',
            name = 'Buried Secrets',
            description = 'Uncover hidden metal objects along the beach.',
            minLevel = 4,
            requirements = {
                { item = 'metal_beach_scrap', amount = 5 },
                { item = 'buried_coin', amount = 2 }
            },
            rewards = {
                money = 750,
                xp = 300
            }
        },
        {
            id = 'adv_treasure_3',
            name = 'Deep Search',
            description = 'A comprehensive beach sweep for all collectibles.',
            minLevel = 5,
            requirements = {
                { item = 'beach_trash', amount = 5 },
                { item = 'metal_beach_scrap', amount = 5 },
                { item = 'buried_jewelry', amount = 1 }
            },
            rewards = {
                money = 1200,
                xp = 500
            }
        }
    },
    
    -- ========================================================================
    -- DAILY MISSIONS - Reset at midnight, bonus rewards
    -- ========================================================================
    Daily = {
        {
            id = 'daily_cleanup',
            name = 'Daily Beach Patrol',
            description = 'Complete the daily cleanup challenge for bonus rewards!',
            minLevel = 1,
            requirements = {
                { item = 'beach_trash', amount = 10 },
                { item = 'beach_plastic', amount = 5 }
            },
            rewards = {
                money = 500,
                xp = 250
            },
            isDaily = true
        },
        {
            id = 'daily_treasure',
            name = 'Daily Treasure Hunt',
            description = 'Find hidden treasures for the daily challenge!',
            minLevel = 3,
            requirements = {
                { item = 'metal_beach_scrap', amount = 5 },
                { item = 'buried_coin', amount = 3 }
            },
            rewards = {
                money = 1000,
                xp = 400
            },
            isDaily = true
        }
    }
}

-- ============================================================================
-- TRASH SPAWN ZONES (Visible - Level 1+)
-- ============================================================================
Config.TrashZones = {
    {
        name = 'Vespucci Beach North',
        center = vector3(-1450.0, -1490.0, 2.0),
        radius = 100.0,
        maxSpawns = 15,
        spawnTypes = { 'beach_trash', 'beach_plastic', 'beach_glass' }
    },
    {
        name = 'Vespucci Beach South',
        center = vector3(-1550.0, -1150.0, 2.0),
        radius = 120.0,
        maxSpawns = 20,
        spawnTypes = { 'beach_trash', 'beach_plastic', 'beach_glass' }
    },
    {
        name = 'Del Perro Pier Area',
        center = vector3(-1700.0, -1100.0, 2.0),
        radius = 80.0,
        maxSpawns = 12,
        spawnTypes = { 'beach_trash', 'beach_plastic' }
    }
}

-- ============================================================================
-- METAL SPAWN ZONES (Hidden - Requires Detector, Level 3+)
-- ============================================================================
Config.MetalZones = {
    {
        name = 'Vespucci Metal Zone',
        center = vector3(-1480.0, -1450.0, 2.0),
        radius = 150.0,
        maxSpawns = 8,
        spawnTypes = { 'metal_beach_scrap', 'buried_coin', 'buried_jewelry' },
        spawnWeights = { metal_beach_scrap = 60, buried_coin = 30, buried_jewelry = 10 }
    },
    {
        name = 'Del Perro Metal Zone',
        center = vector3(-1650.0, -1080.0, 2.0),
        radius = 100.0,
        maxSpawns = 6,
        spawnTypes = { 'metal_beach_scrap', 'buried_coin' },
        spawnWeights = { metal_beach_scrap = 70, buried_coin = 30 }
    }
}

-- ============================================================================
-- METAL DETECTOR SETTINGS
-- ============================================================================
Config.MetalDetector = {
    item = 'metal_detector',                  -- Inventory item name
    maxRange = 50.0,                          -- Maximum detection range (meters)
    minRange = 4.5,                           -- Distance to enable digging
    updateInterval = 1000,                    -- HUD update interval (ms)
    digTime = 5000,                           -- Time to dig up item (ms)
    digAnimation = {
        dict = 'amb@world_human_gardener_plant@male@base',
        anim = 'base'
    },

    prop = 'w_am_digiscanner',                -- Handheld Scanner (Real GTA V Model)
    soundEnabled = true,
    pulseSpeedMultiplier = 1.0                -- Speed multiplier based on distance
}

-- ============================================================================
-- UI SETTINGS
-- ============================================================================
Config.UI = {
    theme = {
        primary = '#1a1a1a',                  -- Black
        secondary = '#2d2d2d',                -- Dark gray
        accent = '#e63946',                   -- Red
        accentHover = '#ff4757',              -- Light red
        text = '#ffffff',                     -- White
        textMuted = '#b0b0b0',                -- Gray text
        success = '#2ed573',                  -- Green
        warning = '#ffa502',                  -- Orange
        error = '#ff4757'                     -- Red
    },
    detectorUI = {
        position = 'bottom-right',            -- 'bottom-right', 'bottom-left', 'top-right', 'top-left'
        showDistance = true,
        showDirection = true,
        pulseAnimation = true
    }
}

-- ============================================================================
-- INTERACTION SETTINGS
-- ============================================================================
Config.Interactions = {
    trashPickupTime = 2000,                   -- Time to pick up visible trash (ms)
    trashPickupAnimation = {
        dict = 'pickup_object',
        anim = 'pickup_low'
    },
    npcInteractionDistance = 2.0,             -- Distance to interact with NPCs
    trashRespawnTime = 60,                    -- Seconds before trash respawns
    metalRespawnTime = 120                    -- Seconds before hidden metal respawns
}

-- ============================================================================
-- KEYBINDS (for TextUI fallback)
-- ============================================================================
Config.Keys = {
    interact = 38,                            -- E key
    cancel = 73                               -- X key
}

-- ============================================================================
-- ITEM DEFINITIONS (Moved from items.lua)
-- ============================================================================
Config.Items = {
    -- ========================================================================
    -- VISIBLE BEACH TRASH (Can be seen and collected without equipment)
    -- ========================================================================
    beach_trash = {
        name = 'beach_trash',
        label = 'Beach Trash',
        model = 'prop_cs_rub_binbag_01',
        sellPrice = 5,
        weight = 100,
        rarity = 'common',
        description = 'Collected beach garbage',
        requiresDetector = false
    },
    beach_plastic = {
        name = 'beach_plastic',
        label = 'Plastic Waste',
        model = 'prop_cs_bs_cup',
        sellPrice = 8,
        weight = 50,
        rarity = 'common',
        description = 'Plastic waste from the beach',
        requiresDetector = false
    },
    beach_glass = {
        name = 'beach_glass',
        label = 'Glass Bottle',
        model = 'prop_cs_beer_bot_40oz_02',
        sellPrice = 12,
        weight = 150,
        rarity = 'uncommon',
        description = 'Discarded glass bottle',
        requiresDetector = false
    },
    
    -- ========================================================================
    -- HIDDEN METAL ITEMS (Invisible, requires Metal Detector to find)
    -- ========================================================================
    metal_beach_scrap = {
        name = 'metal_beach_scrap',
        label = 'Metal Scrap',
        model = nil,                          -- No visible model
        sellPrice = 25,
        weight = 200,
        rarity = 'uncommon',
        description = 'Scrap metal found with detector',
        requiresDetector = true
    },
    buried_coin = {
        name = 'buried_coin',
        label = 'Old Coin',
        model = nil,
        sellPrice = 75,
        weight = 20,
        rarity = 'rare',
        description = 'An old coin buried in the sand',
        requiresDetector = true
    },
    buried_jewelry = {
        name = 'buried_jewelry',
        label = 'Buried Jewelry',
        model = nil,
        sellPrice = 250,
        weight = 50,
        rarity = 'legendary',
        description = 'Valuable jewelry found on the beach',
        requiresDetector = true
    },
    
    -- ========================================================================
    -- EQUIPMENT
    -- ========================================================================
    metal_detector = {
        name = 'metal_detector',
        label = 'Metal Detector',
        model = 'w_am_digiscanner',           -- Handheld Scanner
        buyPrice = 5000,
        weight = 1000,
        rarity = 'special',
        description = 'Use to find buried metal objects',
        isEquipment = true,
        requiredLevel = 3
    }
}

-- ============================================================================
-- RARITY COLORS (for UI display)
-- ============================================================================
Config.RarityColors = {
    common = '#b0b0b0',      -- Gray
    uncommon = '#2ed573',    -- Green
    rare = '#3498db',        -- Blue
    legendary = '#f39c12',   -- Gold
    special = '#e63946'      -- Red
}

-- ============================================================================
-- SHOP CONFIGURATION
-- ============================================================================
Config.Shop = {
    -- Items available for purchase
    buyItems = {
        'metal_detector'
    },
    
    -- Items that can be sold
    sellItems = {
        'beach_trash',
        'beach_plastic',
        'beach_glass',
        'metal_beach_scrap',
        'buried_coin',
        'buried_jewelry'
    }
}

-- ============================================================================
-- HELPER FUNCTIONS
-- ============================================================================

--- Get item data by name
--- @param itemName string
--- @return table|nil
function GetItemData(itemName)
    return Config.Items[itemName]
end

--- Get sell price for an item
--- @param itemName string
--- @return number
function GetItemSellPrice(itemName)
    local item = Config.Items[itemName]
    return item and item.sellPrice or 0
end

--- Get buy price for an item
--- @param itemName string
--- @return number
function GetItemBuyPrice(itemName)
    local item = Config.Items[itemName]
    return item and item.buyPrice or 0
end

--- Check if item requires metal detector
--- @param itemName string
--- @return boolean
function ItemRequiresDetector(itemName)
    local item = Config.Items[itemName]
    return item and item.requiresDetector or false
end

--- Get all visible trash types (for spawning)
--- @return table
function GetVisibleTrashTypes()
    local types = {}
    for name, data in pairs(Config.Items) do
        if not data.requiresDetector and not data.isEquipment and data.model then
            types[#types + 1] = name
        end
    end
    return types
end

--- Get all hidden metal types (for detector)
--- @return table
function GetHiddenMetalTypes()
    local types = {}
    for name, data in pairs(Config.Items) do
        if data.requiresDetector then
            types[#types + 1] = name
        end
    end
    return types
end

```


---

# 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://imperiumscripts.gitbook.io/imperium-scripts/scripts/imperium-beach-waste-collector/configuration.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.
