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 Crafting System

Configuration

Below is a table summarizing each Config setting. If you need more detail, see the example code snippet that follows.

Config = {}

-- Which framework should be used? "esx", "qb", or "auto" (auto detects if qb-core or es_extended is started).
Config.Framework = "auto"

-- If true, uses ox_target to interact with stations/peds. If false, uses marker + E press.
Config.Target = false

-- Language for notifications and help texts. Choose between "en", "de", "sp", or "fr".
Config.Language = "en"

-- If you set this to true, then weapons are treated as "items" instead of giving them via weapon wheel.
Config.WeaponAsItem = false

-- If true, you see extra debug messages in the console. If false, the console stays quiet.
Config.showDebug = true


Config.UseCustomNotify = false -- Use custom notify event
Config.UseCustomHelpNotify = false -- Use custom help notify event

Config.Functions = {
    ["notify"] = function(ntype, title, text, time)
        TriggerEvent("delta_hud:notification", "info", "Crafting", text, 5000)
    end,
    ["helpnotify"] = function(key, text)
        TriggerEvent("revolution_helpnotify:showHelpNotify", text, "E")
    end,
}

-- job = "all" => no job restriction
-- job = "police" => only "police" can access
-- job = {"police","ambulance"} => both "police" and "ambulance" can access

Config.CraftingStations = {
    [1] = {
        job = "all",
        enableNPC = false,
        theme = "metal",
        npc = "a_m_m_eastsa_01",
        location = {
            vec4(-294.8039, 2543.8181, 74.4158, 0.0284)
        },
        blip = {
            enable = true,
            label = "Weapon Crafting Station",
            sprite = 566,
            color = 40,
            scale = 0.8
        },
        prop = {
            enable = true,
            model = "prop_tool_bench02_ld",
            heading = 267.9657,
            offsetX = 0.00,
            offsetY = 0.78
        },
        marker = {
            enable = true,
            type = 1,
            size = vector3(1.0, 1.0, 1.0),
            color = { r = 0, g = 0, b = 0, a = 100 },
            rotate = true,
            bobUpAndDown = true,
            faceCamera = false
        },
        items = {
            {
                item = "weapon_pistol",
                label = "Pistol",
                amount = 1,
                description = "A reliable semi-automatic handgun for self-defense.",
                type = "weapon",
                time = 10 * 1000,
                requirements = {
                    {
                        item = "metal_scrap",
                        label = "Metal Scrap",
                        amount = 5,
                        remove = true
                    },
                    {
                        item = "gunpowder",
                        label = "Gunpowder",
                        amount = 3,
                        remove = true
                    }
                }
            },
            {
                item = "bees",
                label = "bees",
                amount = 1,
                description = "A compact and concealable pistol with decent power.",
                type = "item",
                time = 60 * 1000,
                requirements = {
                    {
                        item = "bees",
                        label = "bees",
                        amount = 3,
                        remove = true
                    },
                    {
                        item = "bees",
                        label = "bees",
                        amount = 1,
                        remove = true
                    }
                }
            },
            {
                item = "weapon_combatpistol",
                label = "Combat Pistol",
                amount = 1,
                description = "A compact, lightweight pistol designed for combat.",
                type = "weapon",
                time = 12 * 1000,
                requirements = {
                    {
                        item = "metal_scrap",
                        label = "Metal Scrap",
                        amount = 6,
                        remove = true
                    },
                    {
                        item = "gunpowder",
                        label = "Gunpowder",
                        amount = 4,
                        remove = true
                    },
                    {
                        item = "grip",
                        label = "Grip",
                        amount = 2,
                        remove = true
                    }
                }
            },
            {
                item = "weapon_microsmg",
                label = "Micro SMG",
                amount = 1,
                description = "A lightweight submachine gun for fast engagements.",
                type = "weapon",
                time = 15 * 1000,
                requirements = {
                    {
                        item = "metal_scrap",
                        label = "Metal Scrap",
                        amount = 8,
                        remove = true
                    },
                    {
                        item = "gunpowder",
                        label = "Gunpowder",
                        amount = 6,
                        remove = true
                    },
                    {
                        item = "spring",
                        label = "Spring",
                        amount = 2,
                        remove = true
                    }
                }
            },
            {
                item = "weapon_assaultrifle",
                label = "Assault Rifle",
                amount = 1,
                description = "A powerful full-sized rifle for heavy engagements.",
                type = "weapon",
                time = 20 * 1000,
                requirements = {
                    {
                        item = "metal_scrap",
                        label = "Metal Scrap",
                        amount = 12,
                        remove = true
                    },
                    {
                        item = "gunpowder",
                        label = "Gunpowder",
                        amount = 8,
                        remove = true
                    },
                    {
                        item = "grip",
                        label = "Grip",
                        amount = 3,
                        remove = true
                    }
                }
            }
        }
    },
    [2] = {
        job = "all",
        enableNPC = true,
        theme = "wood",
        npc = "s_m_m_dockwork_01",
        location = {
            vec4(-128.2356, -1033.9167, 26.6540, 239.2586)
        },
        blip = {
            enable = true,
            label = "Crafting Station",
            sprite = 779,
            color = 0,
            scale = 0.8
        },
        prop = {
            enable = true,
            model = "prop_tool_bench02_ld",
            heading = 152.7539,
            offsetX = 0.95,
            offsetY = 0.95
        },
        marker = {
            enable = true,
            type = 1,
            size = vector3(1.0, 1.0, 1.0),
            color = { r = 255, g = 0, b = 0, a = 100 },
            rotate = true,
            bobUpAndDown = true,
            faceCamera = false
        },
        items = {
            {
                item = "medikit",
                label = "Medikit",
                amount = 1,
                description = "A complete first-aid kit for emergencies.",
                type = "item",
                time = 1000 * 1000,
                requirements = {
                    {
                        item = "bandage",
                        label = "Bandage",
                        amount = 2,
                        remove = true
                    },
                    {
                        item = "money",
                        label = "black",
                        amount = 500,
                        remove = true,
                        method = "black"
                    },
                    {
                        item = "fish",
                        label = "fish",
                        amount = 1,
                        remove = true
                    }
                }
            },
            {
                item = "bees",
                label = "bees",
                amount = 1,
                description = "A toolkit for repairing vehicles.",
                type = "item",
                time = 60 * 1000,
                requirements = {
                    {
                        item = "bees",
                        label = "bees",
                        amount = 3,
                        remove = true
                    },
                    {
                        item = "bees",
                        label = "bees",
                        amount = 1,
                        remove = true
                    }
                }
            },
            {
                item = "sandwich",
                label = "Sandwich",
                amount = 1,
                description = "A quick snack to regain energy.",
                type = "item",
                time = 5 * 1000,
                requirements = {
                    {
                        item = "brot",
                        label = "Bread",
                        amount = 1,
                        remove = true
                    },
                    {
                        item = "cheese",
                        label = "Cheese",
                        amount = 1,
                        remove = true
                    }
                }
            },
            {
                item = "syringe",
                label = "Syringe",
                amount = 1,
                description = "Just Syringe.",
                type = "item",
                time = 12 * 1000,
                requirements = {
                    {
                        item = "bandage",
                        label = "Bandage",
                        amount = 3,
                        remove = true
                    },
                    {
                        item = "painkillers",
                        label = "Painkillers",
                        amount = 2,
                        remove = true
                    }
                }
            },
            {
                item = "lockpick",
                label = "Lockpick",
                amount = 1,
                description = "A handy tool to pick simple locks.",
                type = "item",
                time = 8 * 1000,
                requirements = {
                    {
                        item = "metal_scrap",
                        label = "Metal Scrap",
                        amount = 2,
                        remove = true
                    },
                    {
                        item = "duct_tape",
                        label = "Duct Tape",
                        amount = 1,
                        remove = true
                    }
                }
            },
            {
                item = "flashlight",
                label = "Flashlight",
                amount = 1,
                description = "A portable light source for dark areas.",
                type = "item",
                time = 7 * 1000,
                requirements = {
                    {
                        item = "metal_scrap",
                        label = "Metal Scrap",
                        amount = 2,
                        remove = true
                    },
                    {
                        item = "grip",
                        label = "Grip",
                        amount = 1,
                        remove = true
                    }
                }
            },
            {
                item = "weapon_pistol",
                label = "Pistol",
                amount = 1,
                description = "A reliable semi-automatic handgun for self-defense.",
                type = "weapon",
                time = 10 * 1000,
                requirements = {
                    {
                        item = "metal_scrap",
                        label = "Metal Scrap",
                        amount = 5,
                        remove = true
                    },
                    {
                        item = "license",
                        label = "License",
                        amount = 1,
                        remove = false
                    },
                    {
                        item = "gunpowder",
                        label = "Gunpowder",
                        amount = 3,
                        remove = true
                    }
                }
            },
            {
                item = "coffee",
                label = "Coffee",
                amount = 1,
                description = "A warm cup of coffee to boost energy.",
                type = "item",
                time = 5 * 1000,
                requirements = {
                    {
                        item = "wasser",
                        label = "Wasser",
                        amount = 1,
                        remove = true
                    },
                    {
                        item = "coffee_beans",
                        label = "Coffee Beans",
                        amount = 1,
                        remove = true
                    }
                }
            }
        }
    }
}

---------------------------
--       LOCALES         --
---------------------------
Config.Locales = {
    ["en"] = {
        open_craft = "[E] Open Craft Menu",
        success = "You successfully crafted.",
        no_item = "Not enough items for crafting.",
        access_denied = "Your job cannot access this station!",
        collected = "You collected your item!",
        still_crafting = "Your item is not ready yet.",
        item_ready = "Your item is ready to pick up!"
    },
    ["de"] = {
        open_craft = "[E] Öffne das Craft-Menü",
        success = "Du hast erfolgreich hergestellt.",
        no_item = "Nicht genügend Gegenstände zum Herstellen.",
        access_denied = "Dein Job hat hier keinen Zugriff!",
        collected = "Du hast deinen Gegenstand abgeholt!",
        still_crafting = "Dein Gegenstand ist noch nicht fertig!",
        item_ready = "Dein Gegenstand ist jetzt abholbereit!"
    },
    ["sp"] = {
        open_craft = "[E] Abrir menú de creación",
        success = "Has creado con éxito.",
        no_item = "No tienes suficientes objetos para crear.",
        access_denied = "¡Tu trabajo no puede acceder a esta estación!",
        collected = "¡Recogiste tu objeto!",
        still_crafting = "Tu objeto no está listo aún!",
        item_ready = "¡Tu objeto está listo para recoger!"
    },
    ["fr"] = {
        open_craft = "[E] Ouvrir le menu d'artisanat",
        success = "Vous avez fabriqué avec succès.",
        no_item = "Pas assez d'objets pour fabriquer.",
        access_denied = "Votre métier n'a pas accès à cette station!",
        collected = "Vous avez récupéré votre objet!",
        still_crafting = "Votre objet n'est pas encore prêt!",
        item_ready = "Votre objet est prêt à être récupéré!"
    }
}

-- This function is only for 'auto' detection. You can ignore or rename if you want a direct approach.
function getFramework()
    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

PreviousInstallationNextUsage

Last updated 2 months ago

⚙️
⚙️