# installation

## Requirements

| Dependency                               | Notes                                                    |
| ---------------------------------------- | -------------------------------------------------------- |
| [xsound](https://github.com/Xogy/xsound) | Audio streaming library — must start before moh\_carplay |
| FiveM artifact **6116+**                 | Required for statebag support                            |
| OneSync                                  | Must be enabled on your server                           |
| `lua54 'yes'`                            | Already set in the manifest                              |

{% stepper %}
{% step %}

### Download the resource

Clone or download the resource and place it inside your `resources` folder:

```
resources/
└── moh_carplay/
    ├── config.lua
    ├── fxmanifest.lua
    ├── client/
    │   └── client.lua
    ├── server/
    │   └── server.lua
    └── html/
        └── index.html
```

{% endstep %}

{% step %}

### Add to server.cfg

Open your `server.cfg` and add the following lines. Order matters — `xsound` **must** be started first.

```cfg
ensure xsound
ensure moh_carplay
```

{% hint style="warning" %}
If `moh_carplay` starts before `xsound`, audio calls will throw errors and no sound will play.
{% endhint %}
{% endstep %}

{% step %}

### Configure

Open `config.lua` and set your framework and preferences. See the [Configuration](broken://pages/150477a6fd67c77ad0e4902d217de0ea83ea8b92) page for a full breakdown of every option.

At minimum, set the correct framework:

```lua
Config.Framework = "qb-core" -- "qb-core" | "esx" | "standalone"
```

{% endstep %}

{% step %}

### Start your server

Restart your server (or use `ensure moh_carplay` in the console). You should see no errors in the server console.

To verify the resource is working, join a vehicle in-game and run `/music`.
{% endstep %}
{% endstepper %}


---

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