RISK SCRIPTS
TEBEXDISCORD
  • Welcome to RISK DOCUMENTAION
  • Discord Integration
    • Discord Webhooks
    • Discord Bot Token
  • SCRIPTS
    • 🔔Notify
      • ⚙️Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ & Troubleshooting
    • 🚚Cargo Job
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ & Troubleshooting
    • 🖼️Loadingscreen
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • Driving-School
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ & Troubleshooting
    • 🎣FREE AFK Fishing Script
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🚘Vehicle Shop
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🐝Beekeeping Script
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🔎Advanced Metal Detector Script
      • 📝Editable
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🛍️24/7 Market
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🛍️Weapon Market
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🛍️Black Market Script
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🚗Simple Garage
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🎲4 in Row Script
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🎒Outfit Bag Script
      • 💡Installation
      • ⚙️Configuration
      • ⚙️Usage
      • ❔FAQ / Troubleshooting
    • 🔘Radial Menu
      • 💡Installation
      • ⚙️Commands & Event Triggers
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🗒️TicTacToe / X and O
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🏦Simple Banking System
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • ⚙️Advanced Crafting System
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🚜Farming System
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🍕Pizza Delivery Script
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🍾Spin the Bottle
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 🎇Firework Script
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
    • 📦Blindfold
      • 💡Installation
      • ⚙️Configuration
      • 🕵️‍♂️Usage
      • ❔FAQ / Troubleshooting
Powered by GitBook
On this page
  1. SCRIPTS
  2. Advanced Metal Detector Script

Configuration

Below is a condensed example of your Config.lua, showing the essential parameters for an advanced metal detecting system. You can expand or adjust as needed for your server.

Config = {}

-- Framework selection: "auto", "esx", or "qb"
Config.Framework = "auto"
Config.Language  = "en"     -- en, de, fr, sp, pt
Config.DiscordImage = true  -- If true, uses an image in Discord embed
Config.MoneyType = "EUR"    -- Display currency type in NUI (e.g., "USD", "EUR")
Config.ChestModel = "xm_prop_x17_chest_closed"

Config.digTime = 8000       -- ms for the digging progress bar
Config.Item    = "metal_detector"

Config.Price = {
    buy  = 2500,            -- Cost to buy a metal detector
    rent = 500              -- Cost to rent a metal detector
}

-- Keys to disable while scanning/digging
Config.DisableKeys = {21, 24}

-- Shop & NPC
Config.Shop = {
    marker = false,
    npc = true,
    model = "s_m_y_dockwork_01",
    coord = vec4(-1368.8090, -1492.8373, 3.4431, 83.1140),

    blip = {
        label   = "Metal Detector Shop",
        sprite  = 605,
        scale   = 0.7,
        color   = 5,
        visible = true
    }
}

-- Tasks / Achievements
Config.Tasks = {
    [1] = {
        type = "time",
        value = 30,  -- In minutes
        title = "Play 30 Minutes!",
        money = 3000,
        prize = {
            { item="pizza", image="images/items/pizza.png", amount=4 },
            { item="icedtea", image="images/items/icedtea.png", amount=3 }
        }
    },
    -- More tasks...
}

-- Rewards: Items discovered by digging
Config.Rewards = {
    ["jewelry"] = {
        title  = "Jewelry",
        price  = 500,
        chance = 20,
        score  = 80
        -- ...
    },
    ["rock"] = {
        title  = "Rock",
        price  = 25,
        chance = 35,
        score  = 10
        -- ...
    },
    -- More reward items...
}

-- Upgrades: Battery capacity, detection radius, radar, etc.
Config.Upgrades = {
    ["max_battery"] = {
        type        = "upgrade",
        title       = "BATTERY LEVEL",
        image       = "images/upgrades/battery.png",
        description = "...",
        levels = {
            [1] = { time=15 },
            [2] = { time=30, price=30000 },
            -- More levels...
        }
    },
    ["radar"] = {
        type        = "upgrade",
        title       = "RADAR LEVEL",
        image       = "images/upgrades/radar.png",
        description = "...",
        levels = {
            [1] = { radius=0.0 },
            [2] = { radius=50.0, price=50000 },
            [3] = { radius=30.0, price=50000 }
        }
    },
    ["battery"] = {
        type  = "item",
        title = "BATTERY CAPSULE",
        item  = "battery",
        time  = 5000,
        price = 5000
    },
    ["shovel"] = {
        type  = "item",
        title = "SHOVEL",
        item  = "shovel",
        price = 5000
    }
}

-- Localization
Config.Locales = {
    ["en"] = {
        success_buy = "You have successfully purchased it!",
        no_money    = "You don't have enough money!",
        -- ...
        digging     = "Digging...",
        cancel      = "Digging canceled!",
        -- ...
    },
    ["de"] = {
        success_buy = "Du hast es erfolgreich gekauft!",
        -- ...
    },
    -- ...
}

function getFramework()
    -- Auto-detection snippet:
    if Config.Framework == "esx" then
        return exports['es_extended']:getSharedObject(), "esx"
    elseif Config.Framework == "qb" then
        return exports["qb-core"]:GetCoreObject(), "qb"
    elseif Config.Framework == "auto" then
        if GetResourceState('qb-core') == 'started' then
            return exports["qb-core"]:GetCoreObject(), "qb"
        elseif GetResourceState('es_extended') == 'started' then
            return exports['es_extended']:getSharedObject(), "esx"
        end
    end
end

Highlights

  • Config.Framework: "auto" tries to see if qb-core or es_extended is active.

  • Config.Tasks: Time-based or dig-based achievements awarding money and item prizes.

  • Config.Rewards: Items discovered by digging, each with a chance and score.

  • Config.Upgrades: Battery, radius, radar, or shovel (item). Levels may have price or extended time.

  • Config.Locales: Quick multi-language support (English, German, etc.).

PreviousInstallationNextUsage

Last updated 4 months ago

🔎
⚙️