> For the complete documentation index, see [llms.txt](https://docs.kuzquality.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kuzquality.com/resources/premium-resources/meth-cooking/config.md).

# Config

```lua
Config = {}

Config.locale = 'en'

-- Enabling this will add additional prints and display of the resource within the pot
Config.debug = false

----------------------------------
---
--- READ ME!!!
---
--- To restart the script without causing you and everyone else to crash. Instead of restarting it normally.
--- Use our custom command /kq_meth2:restart
---
----------------------------------

----------------------------------
--- SCRIPT CONFIGURATION
----------------------------------

Config.sql = {
    -- The driver to use. Most servers run oxmysql
    -- Available: 'oxmysql', 'mysql', 'ghmattimysql'
    driver = 'oxmysql',

    -- If you use an up-to-date version of oxmysql, set this to `true`.
    -- If you encounter issues with the script, try toggling this.
    newOxMysql = true,
}

Config.recipe = {
    cookingTemperature = 50, -- Always in Celsius (minimum of 40, maximum of 200)

    -- (int)Number between 1 and 10
    cookingDifficulty = 2,

    -- (float/int)Number between 0.1 and 10
    cookingSpeed = 2,
    coolingSpeed = 8,
}


Config.production = {
    -- The amount of meth players can get when producing a perfect lossless batch
    maxItemAmountPerBatch = 10,

    -- Define which item players will get based on the minimum purity of their meth. The highest possible will be given
    itemPerPurity = {
        {
            minimumPurity = 40,
            item = 'kq_meth_low',
        },
        {
            minimumPurity = 80,
            item = 'kq_meth_mid',
        },
        {
            minimumPurity = 95,
            item = 'kq_meth_high',
        },
    },

    dontSaveItemMetadata = false,

    -- Whether to disallow cooking of meth when underground/in tunnels
    disallowCookingWhenUnderground = false,
}

-- Enable or disable specific vehicles for meth cooking
Config.vehicles = {
    -- Base script
    journey = {
        enabled = true,
    },
    journey2 = {
        enabled = true,
    },
    camper = {
        enabled = true,
    },

    -- Part of the expansion pack
    kqrumpo = {
        enabled = true,
    },
    kqrumpo2 = {
        enabled = true,
    },

    -- Camper from VooDoo
    vdcamper = {
        enabled = true,
    },
}

-- Units displayed on the thermometer
Config.units = {
    -- 'c' for Celcius or 'f' for Fahrenheit
    temperature = 'c',
}

-- Scale of the rendered text
Config.textScale = 1.0
-- Font of the rendered text
Config.textFont = 4

-- Information displayed on players screen
Config.display = {
    -- Whether the resource name should be shown on the screen when hovering over
    drawResourceLabelOnHover = true,

    -- Display on the pot
    pot = {
        -- Whether the "raw meth" purity should be displayed. This is the purity of meth before ethanol is added
        displayRawMethPurity = false,
        -- Whether the meth purity should be displayed
        displayMethPurity = false,
    },
    -- Display on the tray
    tray = {
        -- Whether the meth purity should be displayed
        displayMethPurity = false,
        -- Whether the cooling progress of the meth should be displayed
        displayMethCoolingPercentage = false,
    },
}

Config.colors = {
    -- Color of the liquid meth (r, g, b, a)
    liquidMeth = { 96, 169, 179, 5 },
    -- Color of the solid meth (r, g, b, a)
    cooledMeth = { 46, 218, 242, 80 },
}

-- Smoke options
Config.smoke = {
    -- Whether the smoke should be spawned
    enabled = true,
    -- Color of the smoke
    color = 'blue', -- Available colors: blue, cyan, red, green, pink, purple, yellow, white, black

    -- Color of the smoke (used in the Amphetamines DLC)
    alternativeColor = 'white', -- Available colors: blue, cyan, red, green, pink, purple, yellow, white, black

    -- Scale (size) of the smoke
    scale = 1.5,

    -- Whether the smoke should be stay on after the first chemical reaction
    -- false = Smoke will only show when a cooking process is happening, when chemicals are reacting inside the van, a bit more realistic
    -- true = Smoke will start going as soon as the first ingredients are mixed, it will stay on until the process finishes.
    keepSmoking = true,
}

-- The explosion will occur when the temperature is greatly too high and lithium gets added to the substance
Config.explosion = {
    -- Whether it should be possible to explode the van by cooking meth wrong
    enabled = true,

    -- Whether the explosion deals damage to the player and vehicle
    dealsDamage = false,
}

Config.policeAlerts = {
    enabled = true,

    -- Max distance at which the npc's will be able to see and come over to report the smoke
    maxDistance = 120.0,

    -- Chance between 0 and 100
    chancePerPed = 100,
    --chancePerPed = 25,

    -- Jobs which will get notified about the van
    policeJobs = {
        'police',
        'lspd',
        'bcso',
    },

    -- List of possible titles for the dispatch message
    dispatchTitles = {
        'Suspicious van',
        'Smoking van',
        'Blue smoke',
        'Weird van',
    },
    -- List of possible messages for the dispatch message
    dispatchMessages = {
        'There\'s a van with blue smoke coming out of it. It looks really shady!',
        'Someone is inside this van, there\'s blue smoke coming out of it!',
        'This van has been standing here smoking for a while now, please come see it!',
        'Very suspicious van, blue smoke coming out of it, someone is cooking something odd here',
    },

    -- Blip options for the dispatch
    blip = {
        sprite = 636,
        color = 1,
        scale = 1.5,
        text = 'Suspicious van',
        flash = true,
    },
}

-- Item name mapping
-- Here you can replace the script items with items which you may already have on your server
Config.items = {
    meth_lab_kit = 'kq_meth_lab_kit',
    ammonia = 'kq_ammonia',
    acetone = 'kq_acetone',
    ethanol = 'kq_ethanol',
    rubbingAlcohol = 'kq_rubbing_alcohol',
    lithium = 'kq_lithium',
    lithiumDirty = 'kq_lithium_dirty',
    pills = 'kq_meth_pills',
    propaneBottle = 'kq_propane_bottle',
    propaneBottleEmpty = 'kq_propane_bottle_empty',
    methTable = 'kq_meth_table',
    distiller = 'kq_meth_distiller',
    usedCarBattery = 'kq_used_car_battery',
}

-- Gas mask options
Config.gasMask = {
    -- Whether or not the players should get high while cooking meth and not wearing a gas mask
    enabled = true,

    effectType = 'HUFFIN',          -- 'STONED', 'HUFFIN'
    effectStrengthMultiplier = 1.0, -- Overall effect strength

    -- How strong the effects will be when wearing a gas mask (0.1 = 10% strength)
    maskReductionMultiplier = 0.1,

    -- All gas mask mask clothing types
    ids = {
        -- Default Male
        ['mp_m_freemode_01'] = {
            36,
            38,
            46,
            107,
            129,
            130,
            166,
            175,
        },
        -- Default Female
        ['mp_f_freemode_01'] = {
            36,
            38,
            46,
            107,
            129,
            130,
            166,
            175,
        },
    },
}

Config.finish = {
    -- Whether to announce the meth creation using a "Mission complete" style scaleform
    showBigAnnouncement = true,
}

-- Dragging settings
Config.dragging = {
    instantMode = false, -- Disable spring physics smoothing, items follow cursor instantly
}

Config.carBattery = {
    -- Chance of a clean lithium cell spawning instead of a corroded one during the battery opening minigame
    cleanCellChance = 20,
}

Config.distiller = {
    -- Amount of rubbing alcohol per input (1 ethanol)
    inputPerSlot = 2,

    -- Maximum amount of slots for the distiller. Players are able to queue up multiple batches of ethanol to be processed
    maxSlots = 10,

    -- Duration of the processing time for 1 ethanol (in seconds)
    processTime = 40,

    -- Distiller particle effect
    smoke = {
        dict = 'core',
        particle = 'ent_amb_steam_vent_open_lgt',
        scale = 1.5,
        offset = vec3(-0.2, -0.08, 1.4),
    },
}

-- Pre-defined locations for cooking stations and distillers
Config.prePlaced = {
    stations = {
        -- { coords = vec3(x, y, z), rotation = vec3(0, 0, 90) }
    },
    distillers = {
        -- { coords = vec3(x, y, z), rotation = vec3(0, 0, 90) }
    },
}

-- Simple item shop system
-- We highly recommend adding these items to your shops, heists, robberies etc. instead
Config.vendors = {
    ["propane_store"] = {
        locations = {
            vec4(1704.25, 4938.93, 41.08, 58.42),
            vec4(100.29, 6609.47, 30.81, 249.87),
        },
        model = "u_m_m_partytarget",
        idleAnim = {
            dict = "anim@amb@casino@valet_scenario@pose_d@",
            anim = "base_a_m_y_vinewood_01"
        },
        sellItems = {
            ['kq_propane_bottle'] = { label = "Propane tank", price = 1000 },
        },
        buyItems = {
            ['kq_propane_bottle_empty'] = { label = "Empty propane tank", price = 300 },
        },
        blip = {
            enabled = true,
            label = 'Propane dealer',
            sprite = 622,
            color = 62,
            alpha = 255,
            scale = 0.7,
        },
    },

    ["equipment_store"] = {
        locations = {
            vec4(1664.39, 4973.53, 41.28, 216.0),
        },
        model = "ig_talina",
        idleAnim = {
            dict = "amb@world_human_leaning@male@wall@back@foot_up@idle_a",
            anim = "idle_a"
        },
        sellItems = {
            ['kq_meth_table'] = { label = "Meth Cooking station", price = 15000 },
            ['kq_meth_distiller'] = { label = "Ethanol Distiller", price = 25000 },
            ['kq_meth_lab_kit'] = { label = "RV Meth Cooking kit", price = 10000 },
        },
        blip = {
            enabled = true,
            label = 'Equipment dealer',
            sprite = 784,
            color = 62,
            alpha = 255,
            scale = 0.7,
        },
    },
}

Config.placing = {
    checks = {
        -- Whether to only allow the placement of objects in routing buckets which are not `0`.
        -- This prevents players from placing the objects when not in a housing or other system utilizing routing buckets
        onlyInNonDefaultRoutingBucket = false,

        -- Disallow players from placing more than a specified amount of objects
        limits = {
            enabled = false,

            maxStations = 4,
            maxDistillers = 4,
        },

        housing = {
            -- Whether to enable a housing check. This will allow placement of objects, only when inside a house.
            enabled = false,

            -- Available systems:
            -- nolag_properties
            -- origen_housing
            -- bcs_housing
            -- qs-housing
            -- vms_housing
            -- sn_properties
            -- loaf_housing
            system = 'nolag_properties',
        },

        -- You may also restrict the placement of objects to specific areas.
        -- When used with a housing check, it'll allow placement in houses as well as within the defined areas
        whitelistedAreas = {
            enabled = false,

            showBlips = true,
            areas = {
                { coords = vec3(1798.21, 3792.09, 33.58), radius = 200.0 },
            }
        }
    },

    -- Whether only the player who has placed an object can pick it back up
    onlyOwnerCanPickup = true,
}


Config.itemCollection = {
    ammonia = {
        -- Model of the ammonia tank
        model = 'kq_ammonia_tank',

        -- Spawn offset of the tank
        offset = vector3(0, 2.0, 0),

        -- Spawn offsets of the interactable valve (You do not need to touch these at all!)
        valve = {
            model = 'kq_valve',
            offset = {
                coords = vector3(2.4, -0.25, 0.0),
                rotation = vector3(0, 0, 90)
            }
        },

        -- The amount of ammonia which can be taken out of the tanks is limited
        ammoniaAmount = 4, -- the amount of ammonia each tank can output per refill

        -- Ammonia tanks will tasked to be refilled once no ammonia is left inside.
        refillTime = 20, -- refill time in minutes

        -- Blip settings of the ammonia tanks
        -- Find out more: https://docs.fivem.net/docs/game-references/blips/
        blip = {
            sprite = 851,
            color = 39,
            alpha = 255, -- 0 to 255
            scale = 0.5,
            label = 'Ammonia tank'
        },

        locations = {
            { -- Humane labs A
                coords = vector3(3561.24, 3648.0, 41.34),
                rotation = vector3(0, 0, 350),
                blip = true,
            },
            { -- Humane labs B
                coords = vector3(3418.28, 3679.89, 41.34),
                rotation = vector3(0, 0, 80),
                blip = true,
            },
            { -- Humane labs C
                coords = vector3(3458.36, 3641.99, 42.62),
                rotation = vector3(0, 0, 170),
                blip = true,
            },
            { -- Docks
                coords = vector3(334.61, -2679.0, 6.0),
                rotation = vector3(0, 0, 0),
                blip = true,
            },
        },
    },
    battery = {
        collectionDuration = 3, -- time in seconds

        -- Options:
        -- "minigame" = Use a minigame for the collection
        -- "bar" = Use a simple progress bar
        -- "none" = Don't display anything
        type = 'none',

        wrecks = {
            ['prop_rub_carwreck_8'] = {
                chance = 50,
                cooldown = 240,
                batteryOffset = vec3(-0.24, 1.54, 0.55),
                batteryRotation = vec3(0, 5, 90),
            },
            ['prop_rub_carwreck_9'] = {
                chance = 50,
                cooldown = 240,
                batteryOffset = vec3(-0.55, 2.05, 0.78),
                batteryRotation = vec3(0, 10, 90),
            },
            ['prop_rub_carwreck_5'] = {
                chance = 40,
                cooldown = 240,
                batteryOffset = vec3(-0.49, 1.48, 0.56),
                batteryRotation = vec3(0, 5, 90),
            },
            ['prop_rub_buswreck_06'] = {
                chance = 70,
                cooldown = 300,
                batteryOffset = vec3(0.78, -6.3, 0.45),
                batteryRotation = vec3(0, 0, 90),
            },
        },
    },
    simple = {
        {
            enabled = true,
            label = 'rubbing alcohol',

            model = 'prop_cs_script_bottle',
            offset = vector3(0, 0, 0),
            interactionDistance = 1.5,

            item = 'kq_rubbing_alcohol',
            amount = 1,

            animation = {
                dict = 'mp_take_money_mg',
                name = 'put_cash_into_bag_loop',

                attachment = {
                    holdModel = 'prop_cs_script_bottle',

                    delay = 400,
                    bone = 57005,
                    offset = vector3(0.1, 0.08, -0.13),
                    rotation = vector3(0, 15, 0),
                }
            },

            -- Blip settings of the ammonia tanks
            -- Find out more: https://docs.fivem.net/docs/game-references/blips/
            blip = {
                sprite = 653,
                color = 39,
                alpha = 255, -- 0 to 255
                scale = 0.5,
                label = 'Rubbing Alcohol'
            },

            -- All locations of where the loot should spawn at
            locations = {
                {
                    coords = vector3(1393.06, 3607.85, 33.99),
                    rotation = vector3(0, 0, 32),
                    blip = true,
                },
            },
        },
        {
            enabled = true,
            label = 'acetone',

            model = 'kq_acetone',
            offset = vector3(0, 0, 0),
            interactionDistance = 1.5,

            item = 'kq_acetone',
            amount = 1,

            animation = {
                dict = 'mp_take_money_mg',
                name = 'put_cash_into_bag_loop',

                attachment = {
                    holdModel = 'kq_acetone',

                    delay = 400,
                    bone = 57005,
                    offset = vector3(0.1, 0.1, -0.07),
                    rotation = vector3(0, 15, 0),
                }
            },

            -- Blip settings of the ammonia tanks
            -- Find out more: https://docs.fivem.net/docs/game-references/blips/
            blip = {
                sprite = 653,
                color = 39,
                alpha = 255, -- 0 to 255
                scale = 0.5,
                label = 'Acetone'
            },

            -- All locations of where the loot should spawn at
            locations = {
                {
                    coords = vector3(1387.46, 3607.65, 33.99),
                    rotation = vector3(0, 0, 250),
                    blip = true,
                },
                {
                    coords = vector3(1392.87, 3600.58, 38.24),
                    rotation = vector3(0, 0, 40),
                    blip = true,
                },
            },
        },
        {
            enabled = true,
            label = 'pseudoephedrine',

            model = 'ex_office_swag_pills2',
            offset = vector3(0, 0, 0),
            interactionDistance = 1.5,

            item = 'kq_meth_pills',
            amount = 1,

            animation = {
                dict = 'mp_take_money_mg',
                name = 'put_cash_into_bag_loop',

                attachment = {
                    holdModel = 'prop_cs_pills',

                    delay = 400,
                    bone = 57005,
                    offset = vector3(0.06, 0.06, -0.06),
                    rotation = vector3(0, 20, 0),
                }
            },

            -- Blip settings of the ammonia tanks
            -- Find out more: https://docs.fivem.net/docs/game-references/blips/
            blip = {
                sprite = 51,
                color = 39,
                alpha = 255, -- 0 to 255
                scale = 0.5,
                label = 'Pseudoephedrine'
            },

            -- All locations of where the loot should spawn at
            locations = {
                {
                    coords = vector3(1398.0, 3611.27, 35.22),
                    rotation = vector3(0, 0, 250),
                    blip = true,
                },
            },
        },
        {
            enabled = true,
            label = 'meth cooking kit',

            model = 'bkr_prop_meth_bigbag_01a',
            offset = vector3(0, 0, 0),
            interactionDistance = 1.5,

            item = 'kq_meth_lab_kit',
            amount = 1,

            animation = {
                dict = 'anim@heists@load_box',
                name = 'lift_box',

                attachment = {
                    holdModel = 'prop_kitch_pot_huge',

                    delay = 1200,
                    bone = 57005,
                    offset = vector3(0.05, 0.1, -0.3),
                    rotation = vector3(0, 90, 120),
                }
            },

            -- Blip settings of the ammonia tanks
            -- Find out more: https://docs.fivem.net/docs/game-references/blips/
            blip = {
                sprite = 653,
                color = 39,
                alpha = 255, -- 0 to 255
                scale = 0.5,
                label = 'Meth cooking kit'
            },

            -- All locations of where the loot should spawn at
            locations = {
                {
                    coords = vector3(156.01, 3130.21, 42.53),
                    rotation = vector3(0, 0, 99),
                    blip = true,
                },
            },
        },
    },
}

-- Guards will protect specific areas from players. This is used to protect the resources as well as the meth cooking kit itself
Config.guards = {
    enabled = true,
    peds = {
        {
            coords = vector3(1391.41, 3606.02, 34.98),
            heading = 198.0,

            -- Ped model of the guard
            model = 'ig_mrk',

            -- Respawn time in seconds
            respawnTime = 300,

            -- Zone which will be protected by the guarding npc
            zone = {
                coords = vector3(1391.39, 3609.3, 34.98),
                radius = 2.5,
            },
            weapon = 'WEAPON_FLASHLIGHT',

            -- Base animation of the guard
            animation = {
                dict = 'switch@michael@talks_to_guard',
                name = '001393_02_mics3_3_talks_to_guard_idle_guard',
            },
        },
        {
            coords = vector3(164.64, 3132.45, 42.31),
            heading = 189.0,

            -- Ped model of the guard
            model = 'u_m_y_caleb',

            -- Respawn time in seconds
            respawnTime = 300,

            -- Zone which will be protected by the guarding npc
            zone = {
                coords = vector3(157.88, 3130.80, 43.5),
                radius = 2.75,
            },
            weapon = 'WEAPON_KNIFE',

            -- Base animation of the guard
            animation = {
                dict = 'amb@world_human_sunbathe@female@back@base',
                name = 'base',
            },
        },
    }
}


----------------------------------
--- STATIC COOKING STATIONS
----------------------------------

Config.staticStations = {
    -- Whether static cooking stations are enabled
    enabled = true,


    -- Propane bottle system for static stations
    propane = {
        -- Whether propane is required to cook
        enabled = true,

        -- Maximum propane level (number of cooking sessions)
        maxLevel = 5,

        -- Prop model for propane bottle
        model = 'kq_meth_propane',

        -- Offset relative to counter
        offset = vec3(0.5685, 0.0, 0.1635),
    },
}

-- Keybind configuration of the script
-- Find out more here: https://docs.fivem.net/docs/game-references/controls/
Config.keybinds = {
    interact = {
        label = 'E',
        name = 'INPUT_PICKUP',
        input = 38,
    },
    enter = {
        label = 'F',
        input = 23,
        name = 'INPUT_ENTER',
    },
    exit = {
        label = 'F',
        input = 23,
        name = 'INPUT_ENTER',
    },
    drag = {
        label = 'LMB',
        input = 24,
        name = 'INPUT_ATTACK',
    },
    stove = {
        label = 'LMB',
        input = 24,
        name = 'INPUT_ATTACK',
    },
    rotateLeft = {
        label = 'Scroll up',
        input = 96,
        name = 'INPUT_VEH_CINEMATIC_UP_ONLY',
    },
    rotateRight = {
        label = 'Scroll down',
        input = 97,
        name = 'INPUT_VEH_CINEMATIC_DOWN_ONLY',
    },
}

-- If you don't want the sponge to spawn, set this to true.
-- The sponge serves no purpose other than being a draggable sponge
Config.removeSponge = false

```
