> For the complete documentation index, see [llms.txt](https://mythic-scripts.gitbook.io/mythic-scripts-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mythic-scripts.gitbook.io/mythic-scripts-documentation/introduction/installation-guide.md).

# Installation Guide

The installation steps shared by every Mythic Scripts resource, including items, database files, configuration and updates.

This guide covers the steps that every Mythic Scripts resource shares. Each product has its own installation page with the exact items, database files, configuration and start order. Use both together.

## Install a resource

{% stepper %}
{% step %}

### Download and extract

Download the resource from the Cfx.re Portal and extract the archive. See [Getting Started](/mythic-scripts-documentation/introduction/getting-started.md#downloading-your-resources).
{% endstep %}

{% step %}

### Place it in your resources folder

Copy the resource folder into your server's `resources` directory. You can group resources in a category folder, such as `resources/[mythic]/ms_recoil`. FXServer treats folders in square brackets as categories and still finds the resources inside.

Keep the original folder name.
{% endstep %}

{% step %}

### Install the dependencies

Install and start every dependency listed on the product's overview page. See [General Requirements](/mythic-scripts-documentation/introduction/general-requirements.md#common-dependencies) for download links.
{% endstep %}

{% step %}

### Add inventory items

If the product uses inventory items, add them to your inventory. See [Adding inventory items](#adding-inventory-items) below.
{% endstep %}

{% step %}

### Import the database file

If the product stores data, import its SQL file or let it create its tables. See [Importing SQL files](#importing-sql-files) below.
{% endstep %}

{% step %}

### Configure

Open the product's configuration file and adjust it for your server. Each product's Configuration page documents every option.
{% endstep %}

{% step %}

### Add it to server.cfg

Add an `ensure` line for the resource after its dependencies:

{% code title="server.cfg" %}

```cfg
ensure ox_lib
ensure ox_inventory
ensure ms_example
```

{% endcode %}
{% endstep %}

{% step %}

### Restart and verify

Restart the server. Watch the server console for errors from the resource while it starts, then join and test it in game. Press `F8` in game to open the client console.
{% endstep %}
{% endstepper %}

## Adding inventory items

Product item pages give the exact definitions to add.

{% tabs %}
{% tab title="ox\_inventory" %}

1. Open `ox_inventory/data/items.lua`.
2. Paste the item definitions inside the returned table, before its final closing brace.
3. Copy the item images into `ox_inventory/web/images/`. Each image file name must match its item name.
4. Restart the server. ox\_inventory loads item definitions when it starts.
   {% endtab %}

{% tab title="qb-inventory (QBCore)" %}

1. Open `qb-core/shared/items.lua`.
2. Paste the item definitions inside the `QBShared.Items` table.
3. Copy the item images into `qb-inventory/html/images/`.
4. Restart the server.
   {% endtab %}

{% tab title="ESX without ox\_inventory" %}
ESX Legacy stores items in the `items` database table. Insert one row per item with its name, label and weight, then restart the server.

Only some products support ESX without ox\_inventory. Check the product's Compatibility section first.
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Use the item names exactly as documented. The resources look items up by name, so a renamed item stops working unless the product's configuration lets you change the name.
{% endhint %}

## Importing SQL files

Some products create their database tables automatically on first start. Others ship an SQL file that you must import. The product's Database page says which applies.

To import an SQL file into your server's database, use either:

* **HeidiSQL:** connect to the database, open **File → Load SQL file**, select the file and run it.
* **phpMyAdmin:** select the database, open the **Import** tab, choose the file and run the import.

Import the file into the same database your `mysql_connection_string` points to.

## Editing configuration

* Configuration files are plain Lua. Keep the syntax intact: commas between entries, quotes around text, and matching braces.
* Change values rather than deleting keys. The resources expect every key to exist.
* Restart the resource or the server after a change.

If a resource stops starting after a config edit, the server console shows the file and line of the syntax error.

## Updating a resource

{% stepper %}
{% step %}

### Back up your files

Copy your current resource folder somewhere safe. Configuration and locale files are the important ones.
{% endstep %}

{% step %}

### Replace the resource

Delete the old resource folder and copy in the new version under the same name.
{% endstep %}

{% step %}

### Merge your configuration

Compare your backed-up configuration with the new file and copy your values across. New versions can add options, so avoid pasting an old file over the new one.
{% endstep %}

{% step %}

### Apply new items or SQL

If the update adds items or database changes, apply them as described on the product's pages.
{% endstep %}

{% step %}

### Restart

Restart the server and check the console for errors.
{% endstep %}
{% endstepper %}
