# Creating a new crafting table

## Where to add?

{% hint style="info" %}
You can add as many crafting tables in config.lua as many you need.&#x20;
{% endhint %}

You have to add a table like the example to this table: 'CraftingTables'

<details>

<summary>Example</summary>

```lua
{
    Label = "DRUG CRAFTING",
    Model = 'prop_tool_bench02_ld',
    Coords = vector3(244.732, 3111.310, 41.491),
    Heading = 94.5842,
    CameraSettings = {xOffset = 0.9, yOffset = 0.0, zOffset = 1.4, xRotate = 0.0, yRotate = 0.0, zRotate = 90.0}, -- The Camera's position and rotation relative to the table  
    LightSettings = {xOffset = 4.0, yOffset = 0.0, zOffset = 3.0}, -- Where should the light come to the table, also relative to the table
    Spawn = true, -- Wether the script should spawn the given prop for the crafting bench, or not spawn, instead use the existing prop which is at the coords.
    StopCraftingRadius = 5.0, -- After this distance the crafts will be stopped
    ShowBlipradius = 30.0, -- Show the blip on the map after this distance
    Color = '#789461', -- The main color of the menu | Give the value in hex | https://www.google.com/search?q=color+picker&sca_esv=0573b43c5c641ce9&sxsrf=ACQVn0_-hMLWl_zzSwut9j_3K-mWUc4NRQ%3A1707927207554&ei=p-bMZfmqIcOO9u8P3IOsqAQ&udm=&ved=0ahUKEwi5mojUnKuEAxVDh_0HHdwBC0UQ4dUDCBA&uact=5&oq=color+picker&gs_lp=Egxnd3Mtd2l6LXNlcnAiDGNvbG9yIHBpY2tlcjIKEAAYRxjWBBiwAzIKEAAYRxjWBBiwAzIKEAAYRxjWBBiwAzIKEAAYRxjWBBiwAzIKEAAYRxjWBBiwAzIKEAAYRxjWBBiwAzIKEAAYRxjWBBiwAzIKEAAYRxjWBBiwA0jMGlD9A1j2FXABeAGQAQCYAYoBoAGfCaoBAzEuObgBA8gBAPgBAcICBxAjGLACGCfCAgcQABiABBgNwgIHECMYsQIYJ8ICBxAAGIAEGArCAgoQIxiABBiKBRgnwgIFEAAYgATCAggQABiABBjLAeIDBBgAIEGIBgGQBgg&sclient=gws-wiz-serp
    Blip = {use = true, size = 0.9, sprite = 500, color = 2},
    Marker = {use = true, marker = 20, rgb = {233, 88, 69}, bobUpAndDown = false, rotate = false, position = {xOffset = 0.7, yOffset = -0.0, zOffset = 0.6}},
    Crafts = {
        {
            Item = 'drug', 
            Label = 'Pack of drug',
            Object = 'hei_prop_hei_drug_pack_01a', -- Use this if you don't find the right objects for the craft: prop_cs_cardbox_01 
            ObjectSettings = {xOffset = 0.3, yOffset = -0.0, zOffset = 1.3, xRotate = 90.0, yRotate = 0.0, zRotate = 90.0}, -- The Object's position and rotation relative to the table
            MoveToMouse = true, -- The object is moving as you move your mouse
            CreatedAmount = 1,
            XpGive = 2, -- How many xp should one crafting give 
            SuccessChance = 70, -- In percentages
            CraftingTime = 10, -- The time to craft the item in seconds
            Level = 1, -- The level which is needed to use this craft
            Jobs = {''},
            Requirements = {
                {'drug_elements', 'Bolt', 6, false}, -- Item/amount/if the item should be removed when crafting
            },
        },
    },

},
```

</details>

***

## Offset settings

{% hint style="danger" %}
Do not insert real vector3 or vector4 coords to these values! These have to be changed manually.
{% endhint %}

The offset settings can be found at three places during the configuration at the camera or light settings and in the object settings. These offset coords means that they are relative to the crafting table object. Change these values to create the perfect looking crafting table.

<figure><img src="/files/yyccZlnBQKO7XySTs6ur" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/lvTqBdMS5DFzJQ4FdpZx" alt=""><figcaption></figcaption></figure>

***

### Examples&#x20;

#### The item is too low

ObjectSettings = {xOffset = 0.95, yOffset = -0.4, <mark style="color:red;">**zOffset = 0.7**</mark>, xRotate = 0.0, yRotate = 0.0, zRotate = 0.0},

<figure><img src="/files/y2E9nKI2psWw7gMqml9l" alt=""><figcaption><p>With the wrong settings</p></figcaption></figure>

ObjectSettings = {xOffset = 0.95, yOffset = -0.4, <mark style="color:green;">**zOffset = 1.0**</mark>, xRotate = 0.0, yRotate = 0.0, zRotate = 0.0},

<figure><img src="/files/ZeKTrNHMsKvMwHr0CoOu" alt=""><figcaption><p>With the good settings</p></figcaption></figure>

***

#### Rotation is not right

ObjectSettings = {xOffset = 0.2, yOffset = -0.0, zOffset = 1.2, xRotate = 0.0, <mark style="color:red;">**yRotate = 90.0**</mark><mark style="color:red;">, zRotate = 0.0</mark>},

<figure><img src="/files/9RNhmKUtPq6R6f2BNoPn" alt=""><figcaption><p>With the wrong settings</p></figcaption></figure>

ObjectSettings = {xOffset = 0.2, yOffset = -0.0, zOffset = 1.2, xRotate = 0.0, <mark style="color:green;">**yRotate = 0.0, zRotate = 90.0**</mark>**},**

<figure><img src="/files/TOuuy5UUE9ZcLINAz3WA" alt=""><figcaption><p>With the good settings</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.brutalscripts.com/site/scripts/crafting/creating-a-new-crafting-table.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
