Workbench

t1ger_mechanic/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:

["t1ger_vehicledoor"] = { -- output item name
                icon = "https://i.postimg.cc/hvHDrP2S/t1ger-vehicledoor.png", -- output item icon
                materials = { -- materials to craft one piece
                    ["steel"] = 5, -- item name and required amount
                    ["plastic"] = 2, -- item name and required amount
                    ["rubber"] = 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.

How to integrate my own crafting script?

To integrate your own crafting resource follow these steps.

1

Disable the built-in crafting

Navigate to t1ger_mechanic/shared/shop.lua and find the option called Config.Shop.Workbench and set the enable value to false.

2

Find function to modify

Navigate to t1ger_mechanic/client/shop/markers/workbench.lua and find the function called WorkbenchMain.

3

Add your export or event

You will see this section:

Inside the if statement, you can add your own export/event.

Last updated