# Installation

Total setup time is around five minutes.

## Requirements

* FiveM server, recent artifacts
* OneSync (Infinity recommended)
* A supported framework — **ESX**, **QBCore**, or **QBox** (auto-detected)
* [`oxmysql`](https://github.com/overextended/oxmysql)
* [`ox_target`](https://github.com/overextended/ox_target)
* [`ox_lib`](https://github.com/overextended/ox_lib) — only when `notifySystem = 'ox_lib'` (default)
* An inventory: `ox_inventory` (recommended), `qb-inventory`, or ESX legacy
* A **dirty money** item registered in your inventory (see `dirtyMoneyItem` in config)
* *(Optional)* A `launder_tablet` item if you want gated tablet access

## Step 1 — Drop the resource in

Unzip the download into your `resources` folder. The folder/resource name must remain `6LY_moneylaunder` (it's referenced by exports and by escrow).

```
resources/[crime]/6LY_moneylaunder
```

## Step 2 — Add to server.cfg

Start the resource **after** your framework, `oxmysql`, `ox_lib`, and `ox_target`:

```cfg
ensure oxmysql
ensure ox_lib
ensure ox_target
ensure ox_inventory          # or qb-inventory / your ESX inventory
ensure es_extended           # or qb-core / qbx_core
ensure 6LY_moneylaunder
```

## Step 3 — Database

The schema **auto-installs and auto-migrates** on first start (`autoInstallSchema = true`). Two tables are created:

* `tl_moneylaunder_jobs` — active and historical jobs (drop → wash → pickup state)
* `tl_moneylaunder_progress` — per-player XP, level, total washed

To install manually, run `sql/install.sql` against your database and set `autoInstallSchema = false` in `config/config.lua`.

## Step 4 — Register the items

Add these to your inventory (`ox_inventory` `data/items.lua` or your shared items file):

* `cash` — stackable, no usable hook *(or your dirty-money item — set `dirtyMoneyItem` accordingly)*
* `launder_tablet` — usable; the script auto-registers the use hook

The tablet item icon ships at `extras/launder_tablet.png` — drop it into your inventory's image folder.

## Step 5 — Pick a language (optional)

Edit `config/config.lua`:

```lua
locale = 'en',  -- 'en' | 'es' | 'fr' | 'ar'
```

Missing keys fall back to English automatically.

## Step 6 — Restart

Restart the server (or `ensure` the resource). Players use the tablet item, or run `/launder` to open the spatial tablet.

{% hint style="info" %}
The resource ships **escrowed via CFX Asset Escrow**. The Lua source for gameplay logic is encrypted, but the config files (`config/`, `sql/`, `extras/`) are left unencrypted so you can tune them freely.
{% endhint %}


---

# 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://6ly-scripts.gitbook.io/product-docs/scripts/money-launder/installation.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.
