> For the complete documentation index, see [llms.txt](https://docs.t1ger.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.t1ger.net/resources/t1ger-tuning/configuration/shop/workbench.md).

# Workbench

t1ger\_tuning/shared/workbench.lua

## Crafting Categories

Our built in crafting system has a category system to easily craft the required items.

Each category will have:

* `label` (string) — the title of the category
* `description`(string) — the description of the category
* `icon` (string) — an icon for the category
* `recipe` (table) — the items to craft as index and recipe as the value.

## Recipes

The setup of a recipe is indexed by the item name you want to craft:

```lua
["mod_bodywork"] = { -- output item name
                icon = "https://i.postimg.cc/YG4Jj5mR/mod-bodywork.png", -- output item icon
                materials = { -- materials to craft one piece
                    ["steel"]        = 5, -- item name and required amount
                    ["aluminium"]    = 3, -- item name and required amount
                    ["carbon_fiber"] = 2, -- item name and required amount
                    ["plastic"]      = 2, -- item name and required amount
                }
            },
```

* `icon` (string) — the icon of the item to craft
* `materials` (table) — the materials required to craft the item
  * `index` is the item name
  * `number` is the required amount of materials

You can add whatever items you like and require whatever materials and amount that fits your server.

```lua
return {
    { -- PERFORMANCE
        label = "Performance",
        description = "Performance mods are used to upgrade vehicle's performance.",
        icon = "https://i.postimg.cc/VrS35xb4/mod-brakes.png",
        recipe = {
            ["mod_engine"] = {
                icon = "https://i.postimg.cc/G8Z6DXk7/mod-engine.png",
                materials = {
                    ["aluminium"]     = 6,
                    ["steel"]         = 4,
                    ["copper"]        = 3,
                    ["carbon_fiber"]  = 2,
                    ["electric_scrap"]= 2,
                }
            },
            ["mod_brakes"] = {
                icon = "https://i.postimg.cc/VrS35xb4/mod-brakes.png",
                materials = {
                    ["steel"]        = 3,
                    ["rubber"]       = 2,
                    ["copper"]       = 1,
                    ["carbon_fiber"] = 1,
                }
            },
            ["mod_transmission"] = {
                icon = "https://i.postimg.cc/SYC3fcdZ/mod-transmission.png",
                materials = {
                    ["steel"]         = 4,
                    ["aluminium"]     = 2,
                    ["copper"]        = 3,
                    ["synthetic_oil"] = 1,
                    ["plastic"]       = 2,
                }
            },
            ["mod_suspension"] = {
                icon = "https://i.postimg.cc/RJKyLwdT/mod-suspension.png",
                materials = {
                    ["steel"]        = 3,
                    ["rubber"]       = 2,
                    ["aluminium"]    = 2,
                    ["carbon_fiber"] = 1,
                }
            },
            ["mod_armor"] = {
                icon = "https://i.postimg.cc/627DTkG0/mod-armor.png",
                materials = {
                    ["steel"]        = 6,
                    ["carbon_fiber"] = 3,
                    ["rubber"]       = 2,
                    ["brass"]        = 1,
                    ["aluminium"]    = 4,
                }
            },
            ["mod_turbo"] = {
                icon = "https://i.postimg.cc/nMDyxtxx/mod-turbo.png",
                materials = {
                    ["steel"]         = 2,
                    ["copper"]        = 2,
                    ["aluminium"]     = 1,
                    ["plastic"]       = 1,
                    ["electric_scrap"]= 1,
                }
            },
        }
    },

    { -- COSMETICS
        label = "Cosmetics",
        description = "Cosmetic mods are used to customize the vehicle's appearance.",
        icon = "https://i.postimg.cc/4HVqQpPK/mod-respray.png",
        recipe = {
            ["mod_extras"] = {
                icon = "https://i.postimg.cc/62DFZMrs/mod-extras.png",
                materials = {
                    ["plastic"]       = 3,
                    ["aluminium"]     = 1,
                    ["electric_scrap"]= 1,
                }
            },
            ["mod_exterior"] = {
                icon = "https://i.postimg.cc/MMhgB9yC/mod-exterior.png",
                materials = {
                    ["aluminium"] = 4,
                    ["plastic"]   = 3,
                    ["glass"]     = 1,
                }
            },
            ["mod_interior"] = {
                icon = "https://i.postimg.cc/hzHNm2Lv/mod-interior.png",
                materials = {
                    ["plastic"]       = 4,
                    ["rubber"]        = 2,
                    ["synthetic_oil"] = 1,
                }
            },
            ["mod_horn"] = {
                icon = "https://i.postimg.cc/Q9Rv7fQ8/mod-horn.png",
                materials = {
                    ["copper"]        = 2,
                    ["plastic"]       = 2,
                    ["electric_scrap"]= 1,
                }
            },
            ["mod_headlights"] = {
                icon = "https://i.postimg.cc/dkzgC52w/mod-headlights.png",
                materials = {
                    ["glass"]         = 2,
                    ["plastic"]       = 2,
                    ["electric_scrap"]= 2,
                }
            },
            ["mod_livery"] = {
                icon = "https://i.postimg.cc/wySnNwX7/mod-livery.png",
                materials = {
                    ["plastic"]       = 3,
                    ["synthetic_oil"] = 2,
                    ["acid"]          = 1,
                }
            },
            ["mod_neon"] = {
                icon = "https://i.postimg.cc/TLZBbtVy/mod-neon.png",
                materials = {
                    ["plastic"]       = 3,
                    ["glass"]         = 2,
                    ["electric_scrap"]= 2,
                }
            },
            ["mod_plate"] = {
                icon = "https://i.postimg.cc/BPHkB2pv/mod-plate.png",
                materials = {
                    ["aluminium"] = 2,
                    ["plastic"]   = 2,
                    ["steel"]     = 1,
                }
            },
            ["mod_respray"] = {
                icon = "https://i.postimg.cc/4HVqQpPK/mod-respray.png",
                materials = {
                    ["synthetic_oil"] = 2,
                    ["acid"]          = 2,
                    ["plastic"]       = 1,
                }
            },
            ["mod_tyresmoke"] = {
                icon = "https://i.postimg.cc/kDb0CdCq/mod-tyresmoke.png",
                materials = {
                    ["synthetic_oil"] = 2,
                    ["rubber"]        = 2,
                    ["acid"]          = 1,
                }
            },
            ["mod_windowtint"] = {
                icon = "https://i.postimg.cc/9z762j2f/mod-windowtint.png",
                materials = {
                    ["plastic"]       = 2,
                    ["synthetic_oil"] = 1,
                    ["acid"]          = 1,
                }
            },
            ["mod_wheels"] = {
                icon = "https://i.postimg.cc/yWZMKzK6/mod-wheels.png",
                materials = {
                    ["aluminium"] = 4,
                    ["steel"]     = 2,
                    ["rubber"]    = 2,
                }
            },
            ["mod_bodywork"] = {
                icon = "https://i.postimg.cc/YG4Jj5mR/mod-bodywork.png",
                materials = {
                    ["steel"]        = 5,
                    ["aluminium"]    = 3,
                    ["carbon_fiber"] = 2,
                    ["plastic"]      = 2,
                }
            },
            ["mod_enginebay"] = {
                icon = "https://i.postimg.cc/7GpjzKgW/mod-enginebay.png",
                materials = {
                    ["aluminium"]      = 4,
                    ["copper"]         = 3,
                    ["plastic"]        = 2,
                    ["electric_scrap"] = 2,
                }
            },
        }
    },

    { -- KITS AND TOOLS
        label = "Kits & Tools",
        description = "Kits are used by tuners for different stuff.",
        icon = "https://i.postimg.cc/gxCk6rqd/tuner-tablet.png",
        recipe = {
            ["tuner_tablet"] = {
                icon = "https://i.postimg.cc/gxCk6rqd/tuner-tablet.png",
                materials = {
                    ["plastic"]       = 3,
                    ["electric_scrap"]= 4,
                    ["glass"]         = 2,
                    ["copper"]        = 2,
                    ["aluminium"]     = 1,
                }
            },
            ["tuner_repairkit"] = {
                icon = "https://i.postimg.cc/LJc6ZhBS/tuner-repairkit.png",
                materials = {
                    ["steel"]         = 2,
                    ["plastic"]       = 2,
                    ["rubber"]        = 1,
                    ["synthetic_oil"] = 1,
                    ["electric_scrap"]= 1,
                }
            },
            ["tuner_enghoist"] = {
                icon = "https://i.postimg.cc/QF2xWVg2/tuner-enghoist.png",
                materials = {
                    ["steel"]         = 5,
                    ["scrap_metal"]   = 3,
                    ["rubber"]        = 2,
                    ["carbon_fiber"]  = 1,
                    ["synthetic_oil"] = 1,
                    ["brass"]         = 1,
                }
            },
            ["nos_empty_bottle"] = {
                icon = "https://i.postimg.cc/LJc6ZhBF/nos-empty-bottle.png",
                materials = {
                    ["steel"]         = 3,
                    ["aluminium"]     = 2,
                    ["carbon_fiber"]  = 1,
                    ["synthetic_oil"] = 1,
                    ["rubber"]        = 1,
                    ["acid"]          = 1,
                }
            },
            ["nos_purge_dye"] = {
                icon = "https://i.postimg.cc/ZWGKy0Ft/nos-purge-dye.png",
                materials = {
                    ["synthetic_oil"] = 6,
                    ["acid"]          = 8,
                    ["plastic"]       = 1,
                    ["copper"]        = 1,
                    ["glass"]         = 2,
                }
            },
        }
    },

    { -- CUSTOM
        label = "Custom",
        description = "Custom items can be crafted here.",
        icon = "https://i.ibb.co/vQXJgJd/mod-bullettires.png",
        recipe = {
            ["mod_bullettires"] = {
                icon = "https://i.ibb.co/vQXJgJd/mod-bullettires.png",
                materials = {
                    ["rubber"]        = 5,
                    ["steel"]         = 4,
                    ["carbon_fiber"]  = 3,
                    ["synthetic_oil"] = 2,
                }
            },
            ["mod_drifttires"] = {
                icon = "https://i.ibb.co/pRx0whN/mod-drifttires.png",
                materials = {
                    ["rubber"]        = 6,
                    ["steel"]         = 2,
                    ["synthetic_oil"] = 2,
                    ["plastic"]       = 1,
                }
            },
            ["mod_stocktires"] = {
                icon = "https://i.ibb.co/mHVgnsz/mod-stocktires.png",
                materials = {
                    ["rubber"]        = 4,
                    ["steel"]         = 1,
                    ["synthetic_oil"] = 1,
                }
            },
        }
    },

}
```

## How to integrate my own crafting script?

To integrate your own crafting resource follow these steps.

{% stepper %}
{% step %}

### Disable the built-in crafting

Navigate to `t1ger_tuning/shared/shop.lua` and find the option called `Config.Shop.Workbench` and set the `enable` value to `false`.
{% endstep %}

{% step %}

### Find function to modify

Navigate to `t1ger_tuning/client/shop/markers/workbench.lua` and find the function called `WorkbenchMain`.
{% endstep %}

{% step %}

### Add your export or event

You will see this section:

```lua
    if not Config.Shop.Workbench.enable then
        -- add export/event to open your own crafting stuff 
    else
```

Inside the if statement, you can add your own export/event.
{% endstep %}
{% endstepper %}
