# Installation & Configuration

First, you need to install the scripts **required** for **Qubit 3D Printer** to work. After installing these scripts, you can put **qubit-3dprinter** into your resources folder and run it.

* oxmysql / mysql-async
* ox\_lib - [**Download Here**](https://github.com/overextended/ox_lib/releases/download/v3.11.0/ox_lib.zip)
* ox\_target - [**Download Here**](https://github.com/overextended/ox_target/releases/download/v1.13.1/ox_target.zip)
* bzZzi 3D Prop **( Optional for Big Printer )**  -[ **Download Here**](https://forum.cfx.re/uploads/short-url/oCBJlT6BUwaro9wAbL6nsBhbdNB.zip)
* Gizmo Object **( Optional )** - [**Download Here**](https://github.com/Demigod916/object_gizmo/releases/download/v2.0.2/object_gizmo.zip)

## 1. Framework Configration

Qubit Vehicle Crafting supports ESX and QB frameworks. If you're using a different framework, unfortunately you won't be able to run Qubit Car Crafting.

Open the `config.lua` and `fxmanifest.lua` change framework setttings for your needs

<details>

<summary>QBCore Settings</summary>

If you're using the qbcore framework, you should configure the framework settings in the config as follows

&#x20;Open `config.lua` and change these lines

```lua
Config.Framework = "QB" -- QB, oldESX, ESX
Config.CoreName = 'qb-core' -- qb-core, es_extended
```

</details>

<details>

<summary>ESX Settings</summary>

If you're using the qbcore framework, you should configure the framework settings in the config as follows

&#x20;Open `config.lua` and change these lines

```lua
Config.Framework = "ESX" -- QB, oldESX, ESX
Config.CoreName = 'es_extended' -- qb-core, es_extended
```

</details>

## 2. Defining Items

You can produce any item with a 3D Printer. All you need to do is add the item you want to produce to `Config.PrintItems`

{% hint style="success" %}
**Here is example 3D Print item definition**&#x20;
{% endhint %}

```lua
["weapon_pistol"] = { -- Item Name
    title = "9mm Pistol", -- Menu Name
    description = "Start process of 3D object", -- Menu Description
    visual_value = "w_pi_pistol", -- Object Name
    visual_value_type = "object",  -- "object" or "image"  (IT'S UNDER DEVELOPMENT, USE ONLY "OBJECT"),
    printingTime = 120, -- Printing Seconds
    batteryConsumeRate = 1.0, -- This value determines how much resources will be consumed in 5 seconds.
    resinConsumeRate = 1.0, -- This value determines how much resources will be consumed in 5 seconds.
},
```

## 3. Importing Items

To use the Qubit 3D Printer, you need to integrate the printer, battery, and resin items into your framework. Follow these steps to add the items

{% hint style="info" %}
If you are using QBCore or OX, you don't need to import the SQL.
{% endhint %}

<details>

<summary>QBCore Item Configration</summary>

Go to the **qb-core** folder, open `qb-core/shared/items.lua`, and add the crafting items line at the bottom

```lua
['3d_printer'] 					 = {['name'] = '3d_printer', 			 	  	  	['label'] = '3D FX Printer', 	['weight'] = 0, 		['type'] = 'item', 		['image'] = '3d_printer.png', 				['unique'] = true, 	['useable'] = true, 	['shouldClose'] = true,   ['combinable'] = nil,   ['description'] = '3D Metal object printer.'},
['3d_resin'] 					 = {['name'] = '3d_resin', 			 	  	  	['label'] = '3D Printer Resin Mix', 	['weight'] = 0, 		['type'] = 'item', 		['image'] = '3d_resin.png', 				['unique'] = true, 	['useable'] = true, 	['shouldClose'] = true,   ['combinable'] = nil,   ['description'] = '3D FX Printer Resin.'},
['3d_battery'] 					 = {['name'] = '3d_battery', 			 	  	  	['label'] = '3D Printer Battery', 	['weight'] = 0, 		['type'] = 'item', 		['image'] = '3d_battery.png', 				['unique'] = true, 	['useable'] = true, 	['shouldClose'] = true,   ['combinable'] = nil,   ['description'] = '3D FX Printer Battery.'},
```

</details>

<details>

<summary>ESX Item Configration</summary>

Open your database and import these SQL lines for inventory.

```sql
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('3d_printer','3D FX Printer','1','1','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('3d_resin','3D Printer Resin Mix','1','1','1');
INSERT INTO `items`(`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('3d_battery','3D Printer Battery','1','1','1');
```

</details>

<details>

<summary>OX Item Configration</summary>

Go to `ox_inventory/data/items.lua` and copy & paste these items in bottom

```lua
	["3d_printer"] = {
		label = "3D FX Printer",
		weight = 1,
		stack = true,
		close = true,
	},

	["3d_resin"] = {
		label = "3D Printer Resin Mix",
		weight = 1,
		stack = true,
		close = true,
	},
	
	["3d_battery"] = {
		label = "3D Printer Battery",
		weight = 1,
		stack = true,
		close = true,
	},
```

</details>

## Setup Finished 🎉

After configuring your items, you can start using the 3D Printer. If you encounter any issues during the setup process, please visit our Discord for more comprehensive support.


---

# 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.qubitstudios.net/fivem-scripts/3d-printer/installation-and-configuration.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.
