# Troubleshooting

Common issues and their fixes. If yours isn't here, open a Discord ticket with your server console output and the affected section of `config.lua`.

## "Resource failed to start"

Check the console for the error line. Usual causes:

* **Dependency order in `server.cfg`.** `oxmysql`, `ox_target`, `ox_lib`, and your framework / inventory must all `ensure` **before** `6LY_moneylaunder`.
* **Old FiveM artifacts.** Update to recent build; the React NUI needs current Chromium.
* **`oxmysql` not configured.** Confirm your `set mysql_connection_string` resolves to a reachable DB; the auto-installer needs DDL permission on first start.

## `/launder` does nothing

* If `requireTabletItem = true` in `config.lua`, the player needs a `launder_tablet` in inventory. Give one with your admin command or set the flag to `false`.
* Confirm the resource is actually started (`refresh; ensure 6LY_moneylaunder` then check the console).
* If the tablet opens but is blank, that's an NUI cache issue — re-join the server once.

## Tablet item doesn't appear in inventory

The script doesn't auto-add items to your inventory's registry — that's framework-side. See **Installation → Step 4** for the `ox_inventory` / `qb-inventory` / ESX legacy snippets.

Image rendering: drop `extras/launder_tablet.png` into your inventory resource's images folder (`ox_inventory/web/images/` for ox).

## "Insufficient dirty money"

The script looks for `TL.Config.dirtyMoneyItem` (default `'cash'`) in the player's inventory. If your server uses a different item name (e.g. `black_money` on ESX, `dirty_money` on some QB forks), change the config value:

```lua
dirtyMoneyItem = 'black_money',
```

For ESX **accounts**-based dirty money (`xPlayer.getAccount('black_money')`), open a Discord ticket — the bridge needs a one-line tweak.

## Player drops the cash but the wash never starts

Check the job state in the DB:

```sql
SELECT id, state, channel_id FROM tl_moneylaunder_jobs WHERE identifier = '<player_id>' ORDER BY created_at DESC LIMIT 5;
```

* `pending_drop` — they haven't actually completed the handoff. Distance check failed; have them re-approach the boss.
* `pending_delivery` — they owe a truck delivery (gas stations / shipments). The wash only starts after `truckDelivery` coords are reached within `deliveryRadius`.
* `washing` — wash is running; check `ready_at` against `UNIX_TIMESTAMP()`.

## Crate carry is stuck on the player

The carry anim is held in client state. The boss-walk-away interaction clears it; otherwise rejoining the server resets `carriedCrate`. If you find a stable repro, file a ticket — that's a script bug, not a config issue.

## Player relogged mid-truck mission

This is supported. Job stays in `pending_delivery` in the DB. Player re-contacts the boss; truck and remaining crates respawn. Already-loaded crates are skipped via `crates_mask` sync — no double-load possible.

## Server restart mid-job

All jobs persist in the DB. In-memory state that resets:

* Rate-limit cooldowns
* The `deliveryDone[jobId]` set (truck workflows)

Players in `pending_delivery` will need to re-deliver the truck. Jobs in `washing` continue to count down based on `ready_at`. Jobs in `ready` are unaffected.

## "Not at boss" / distance errors

`maxInteractDistance` defaults to `3.0` meters. The server enforces this on every drop, pickup, and "I'm finished" call. If your map has wonky collision near a coord:

1. Try a slightly higher distance (4.0 or 5.0) — but the higher you go the easier it is for cheaters to spoof location.
2. Move the boss to a friendlier coord in `locations.lua`.

## Fake-finish penalty triggered unexpectedly

If a player drives the truck close to but not within `truck.deliveryRadius` of `truckDelivery` and presses **Finish**, the server applies `truck.falseCheckPenalty` (1% on gas, 3% on shipments). Raise `deliveryRadius` slightly if you find your delivery coord is too tight against geometry.

## XP / level not updating

* Confirm `xpPerJob` and `xpPerThousand` are non-zero for the channel.
* The job must reach state `collected` — `washing` and `ready` jobs don't award XP.
* Check `tl_moneylaunder_progress.updated_at` for the player's identifier. If `0`, the bridge didn't pick up an identifier on join — likely a multi-framework conflict.

## Performance

Idle: 0.00ms client, \~0.00ms server. During a job: 0.02–0.05ms client, negligible server. If you're seeing more, the culprit is usually:

* Forked locale or config with a runaway loop
* Many active blips when `showBlips = true` and you have a lot of channels

Revert to the shipped configs and re-test.

## Still stuck?

Open a ticket in our [Discord](https://discord.gg/JUyc3rVkDM) with:

* Server artifacts version
* Framework + inventory you're running
* Console output from the resource start
* Relevant section of `config/config.lua` (paste from the file, never your DB connection string)


---

# 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/troubleshooting.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.
