[ESX/QBCore] Advanced Treasure Hunting

Hello to you today I made the advanced treasure hunting script, I hope you like it. :slight_smile:
I designed the objects myself (except pickaxe and shovel) you can edit many things you want from the config file.

Config = {}
Config.FreamWork = 'ESX' - -ESX OR QBCORE

Config.Waypoint = true -- true or nil
Config.Axe = true -- true or nil


Config.Waypoint = true -- true or nil
Config.Axe = true -- true or nil

Config.PoliceNotify = true -- true or nil

Config.keyrequirement = false -- true or nil (if you want to use key for chest)
Config.axerequirement = true -- true or nil (if you want to use axe for treasure)
Config.ChestKey = 'chest_key' -- item name
Config.Axe = 'pickaxe' -- item name

Config.Distance = 181 -- distance for the mission to be canceled
Config.Text = {
    ["axe_progressbar"] = "being dug up",
    ["shovel_progressbar"] = "digging the chest",
    ["keynotfound"] = "No key found to open the chest",
    ["pickaxenotfound"] = "No pickaxe found to dig the chest",
    ["highdistance"] = "the treasure was lost because you walked away",
    ["policenotice"] = "Illegal excavation",
    ["digging"] = "Digging",
    ["chest_removed"] = "chest is being removed",
    ["receiving_crate"] = "receiving crate",
    ["pickupchest"] = "You took the chest",
    ["waypoint"] = "treasure marked",
}

Config.ChestChance = { -- Standart Chest
["10"] = { -- Items to be given with 10% probability
items = {
    {
        name = "gold",
        count = 1
    },
    {
        name = "diamond",
        count = 1
    }
},
},
["30"] = { -- Items to be given with 30% probability
    items = {
        {
            name = "gold",
            count = 2
        },
        {
            name = "diamond",
            count = 2
        }
    },
},
["60"] = { -- Items to be given with 60% probability
    items = {
        {
            name = "gold",
            count = 3
        },
        {
            name = "diamond",
            count = 3
        }
    },
},
--80
["80"] = { -- Items to be given with 80% probability
    items = {
        {
            name = "gold",
            count = 4
        },
        {
            name = "diamond",
            count = 4
        }
    },
},
["100"] = { -- Items to be given with 100% probability
    items = {
        {
            name = "gold",
            count = 5
        },
        {
            name = "diamond",
            count = 5
        }
    },
},
}

    Config.SeaChestChance = { -- Sea Chest
    ["10"] = { -- Items to be given with 10% probability
    items = {
        {
            name = "gold",
            count = 1
        },
        {
            name = "diamond",
            count = 1
        }
    },
    },
    ["30"] = { -- Items to be given with 30% probability
        items = {
            {
                name = "gold",
                count = 2
            },
            {
                name = "diamond",
                count = 2
            }
        },
    },
    ["60"] = { -- Items to be given with 60% probability
        items = {
            {
                name = "gold",
                count = 3
            },
            {
                name = "diamond",
                count = 3
            }
        },
    },
    --80
    ["80"] = { -- Items to be given with 100% probability
        items = {
            {
                name = "gold",
                count = 4
            },
            {
                name = "diamond",
                count = 4
            }
        },
    },
    ["100"] = { -- Items to be given with 100% probability
        items = {
            {
                name = "gold",
                count = 5
            },
            {
                name = "diamond",
                count = 5
            }
        },
    },
}

Config.Location = {
    [1] = vector3(-940.76, 4825.04, 311.04),
    [2] = vector3(610.6, 5552.64, 713.36),
    [3] = vector3(3248.4, 6116.76, 45.48),
    [4] = vector3(3709.24, 4924.16, 16.92),
    [5] = vector3(-200.76, 2327.36, 96.44),
    [6] = vector3(-2855.08, 1596.28, 38.36),
    [7] = vector3(-1025.6, 1012.08, 160.76),
    [8] = vector3(1730.08, -2554.72, 63.16),
    [9] = vector3(1329.52, -1132.56, 39.68),
    [0] = vector3(1682.52, 504.52, 221.76),
}

Config.Chest = { --Pirate Chest
    [1] = vector3(-2588.54, -610.81, -37.72),
    [2] = vector3(3108.68, -200.16, -27.42),
    [3] = vector3(3188.76, 1158.08, -47.48),
    [4] = vector3(3586.72, 5839.76, -22.65),
    [5] = vector3(2512.28, 6877.72, -22.6),
}


Watch the video for details
Preview
Tebex

3fe Modding & Dev.

Scripts

MAPS

Code is accessible True
Subscription-based No
Lines (approximately) 400
Requirements Any Framework
Support Yes
4 Likes

cool script

thank you :heart:

looks good

thank you :heart:

nice script bro!

Did you design the props?

I designed the objects myself (except pickaxe and shovel)