# Adding New Drugs

* Open `server/config.lua`
* Add a new drug in the `DrugDefinitions` list
* An example is provided for you:

```lua
{ -- EXAMPLE
    id = 'drug_id', -- unique identifier for the drug
    name = 'Drug Name', -- name of the drug
    description = 'Description of the drug', -- description of the drug
    icon = 'fa-icon-name', -- FontAwesome icon (without the "fas" prefix)
    color = 'blue', -- Valid colors: 'blue', 'pink', 'orange', 'green'
    ingredients = { -- list of ingredients required to make the drug
        -- Must have a minimum of 1 ingredient, no maximum amount
        -- id: item name of the ingredient (string)
        -- name: display name of the ingredient for UI (string)
        -- amount: amount of the ingredient required (number)
        { id = 'ingredient_id1', name = 'Ingredient Name 1', amount = 1},
        { id = 'ingredient_id2', name = 'Ingredient Name 2', amount = 2},
        { id = 'ingredient_id3', name = 'Ingredient Name 3', amount = 3}
        { id = 'ingredient_id4', name = 'Ingredient Name 4', amount = 4}
        { id = 'ingredient_id5', name = 'Ingredient Name 5', amount = 5}
    },
    -- optional: define a custom ideal formula (must match number of ingredients)
    -- if not provided, the server will generate this randomly on startup
    idealMix = {40, 30, 30, 20, 10},
    effects = 'Effects description for UI display' -- effects of the drug (string, for UI)
},
```

* So, based on this example we could add a new Drug called "Molly":

```lua
{
    id = 'molly',
    name = 'Molly',
    description = 'Pure MDMA in crystalline form',
    icon = 'fa-heart',
    color = 'pink',
    ingredients = {
        { id = 'safrole_oil', name = 'Safrole Oil', amount = 5},
        { id = 'methylamine', name = 'Methylamine', amount = 3},
        { id = 'hydrogen_peroxide', name = 'Hydrogen Peroxide', amount = 2}
    },
    idealMix = {70, 50, 20},
    effects = "Pure euphoria in crystalline form. Users experience waves of bliss, enhanced sensations, and boundless energy. The comedown is just as legendary as the high."
},
```

* We can specify an `idealMix` here, defining the formula for a player to use of the ingredients. In this example, a formula of `70` Safrole Oil, `50` Methylamine and `20` Hydrogen Peroxide would make a package with the perfect purity. *These do not need to add up to 100.*
* If you don't define an `idealMix`, the server will generate it automatically every restart. I would **recommend allowing this to happen**, as it makes sure your players need to experiment everyday to find the perfect formula.
* The ingredients you add **must also exist in your inventory resource**. So for our example, `safrole_oil`, `methylamine` and `hydrogen_peroxide` should be added to `ox_inventory/data/items.lua` (or your custom inventory) like the example below:

```lua
-- MDMA/Molly ingredients
['safrole_oil'] = {
    label = 'Safrole Oil',
    weight = 180,
    stack = true,
    degrade = 4320, -- 3 days
    decay = true,
    description = 'An essential oil extracted from sassafras plants, used in MDMA production.',
    client = {
        image = 'safrole_oil.png',
    }
},

['methylamine'] = {
    label = 'Methylamine',
    weight = 220,
    stack = true,
    degrade = 5760, -- 4 days
    decay = true,
    description = 'A colorless gas derivative of ammonia used in various drug syntheses.',
    client = {
        image = 'methylamine.png',
    }
},

['hydrogen_peroxide'] = {
    label = 'Hydrogen Peroxide',
    weight = 150,
    stack = true,
    degrade = 8640, -- 6 days
    decay = true,
    description = 'A strong oxidizer used in chemical reactions and drug manufacturing.',
    client = {
        image = 'hydrogen_peroxide.png',
    }
},
```

* It's your choice what you choose for weight, decay, etc. I would *recommend setting realistic weights and decay values*. It ensures your players can't stockpile ingredients, and makes for some reasonable inventory management. You will need to either make your own inventory images, or find them online. [Here is a useful link for free item images.](https://github.com/bitc0de/fivem-items-gallery/tree/main)
* Finally, add your new drug type to the `DrugPriceModifiers` table, for example:

```lua
["molly"] = 1.4, -- Molly  sells for 40% more than base price
```

:tada: **That's it, you're done!** After saving your changes and restarting the resource, this new drug will appear in the Drug Processing UI: both on the products tab with the information you supplied, and on the mixing tab for players to begin creating them.

<figure><img src="https://737274200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1US2IqenUQWypVR7rbp2%2Fuploads%2F4U5BoR10xXahwsMKZEk6%2Fmolly2.png?alt=media&#x26;token=ce812184-77e6-4f88-b99a-277bc58b69c3" alt=""><figcaption><p>"Molly" in the Products menu</p></figcaption></figure>

<figure><img src="https://737274200-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1US2IqenUQWypVR7rbp2%2Fuploads%2Flsut5CB0aAaYlu41Ocnu%2Fmolly.png?alt=media&#x26;token=adfb4c18-e1d8-4292-b035-5cba333e6bdf" alt=""><figcaption><p>"Molly" in the Mixing menu</p></figcaption></figure>
