# Installation Guide

### 1. Prerequisites

Before installing, ensure your server meets the following requirements:

* Framework: `qb-core` or `esx` (Configurable in `config.lua`)
* Target System: `qb-target` or `ox_target` (Configurable in `config.lua`)
* Inventory System: `qb-inventory` or `ox_inventory`
* Menu System: `qb-menu` or `ox_lib` (Configurable in `config.lua`)

### 2. Resource Setup

1. Download the script package.
2. Place the `kvl-chemicals` folder into your server's `resources` directory.
3. Add the following line to your `server.cfg`:

   ```
   ensure kvl-chemicals
   ```

### 3. Database Import

Execute the provided `KVLChemicals.sql` file in your database (MySQL/HeidiSQL). This creates the necessary tables for lab ownership, tier upgrades, and reputation tracking.

### 4. Configuration

Open `config.lua` and adjust the settings according to your server's needs:

* Framework & Systems: Set your `KVL['Framework']`, `KVL['TargetSystem']`, and `KVL['MenuSystem']`.
* Language: Set `KVL['Locale']` to either `'tr'` or `'en'`.
* Economy: You can adjust the `KVL['Selling']['Prices']` to balance your server's economy.

### 5. Adding Items

Add the required items from the provided `items.lua` (or `esx-items.lua`) file to your inventory system:

* QBCore: Add the entries to `qb-core/shared/items.lua`.
* OX Inventory: Add the entries to `ox_inventory/data/items.lua`.

### 6. Framework-Specific Notes

* ESX Users: The script automatically detects `es_extended`. Ensure your `okokNotify` or similar notification system is correctly referenced in `functions.lua` if you choose not to use the default one.
* QBCore Users: Ensure `qb-target` and `qb-menu` are started before `kvl-chemicals` in your `server.cfg`.

### 7. Troubleshooting

* Database Errors: Ensure the `kvl_laboratories` table was created successfully.
* Framework Errors: If the script fails to load, check that `KVL['Framework']` in `config.lua` matches your server's actual framework.

### 8. ENJOY IT!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://kavl.gitbook.io/kvl-store/scripts/chemicals/installation-guide.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.
