# Moh-boombox

Follow these steps to add `moh-boombox` to your FiveM server. The whole process takes under 5 minutes.

## 📦 Setup

{% stepper %}
{% step %}

#### Download & Extract

Place the `moh-boombox` folder inside your server's `resources` directory. The expected structure is:

```
resources/
└── moh-boombox/
    ├── client/
    │   ├── client.lua
    │   └── functions.lua
    ├── server/
    │   └── server.lua
    ├── html/
    │   ├── index.html
    │   └── logo.png
    ├── config.lua
    └── fxmanifest.lua
```

{% endstep %}

{% step %}

#### Add to server.cfg

Ensure moh-boombox loads **after** your framework, xsound, and oxmysql:

```
ensure es_extended # or qb-core ensure xsound ensure oxmysql ensure moh-boombox
```

{% hint style="warning" %}
Load order matters. If moh-boombox starts before xsound or oxmysql, the resource will error on startup.
{% endhint %}
{% endstep %}

{% step %}

#### Add the boombox item

Register the item in your framework so players can use it. See the Items Setup page for ESX and QBCore instructions.
{% endstep %}

{% step %}

#### Configure the script

Open `config.lua` and adjust settings to match your server. At minimum, check:

* `Config.Framework` — set to `'auto'` or your specific framework
* `Config.BoomboxItem` — must match your item name exactly (case-sensitive)
* `Config.Webhook` — paste your Discord webhook URL if you want logging

Full config reference: Configuration
{% endstep %}

{% step %}

#### Restart your server

The database table `boombox_songs` is created automatically on first start — no manual SQL needed. Check your server console for any errors.

{% hint style="success" %}
If you see no errors and the resource shows as **started**, you're done! Give a player a `boombox` item and test it.
{% endhint %}
{% endstep %}
{% endstepper %}

## File Manifest Reference

| File                   | Purpose                                                                        |
| ---------------------- | ------------------------------------------------------------------------------ |
| `fxmanifest.lua`       | Resource manifest — defines scripts, UI page, and dependencies                 |
| `config.lua`           | All user-facing configuration options                                          |
| `client/client.lua`    | Framework detection, target zones, NUI callbacks, sound relay                  |
| `client/functions.lua` | Shared client-side helper functions                                            |
| `server/server.lua`    | Framework detection, DB setup, item registration, event relay, Discord logging |
| `html/index.html`      | Self-contained NUI control panel (no external dependencies)                    |
| `html/logo.png`        | Logo displayed in the NUI header                                               |


---

# 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://mohssins.gitbook.io/mohscriptsdocs/moh-boombox.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.
