> For the complete documentation index, see [llms.txt](https://docs.otherplanet.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otherplanet.dev/scripts/op-mechanic-v2/installation.md).

# Installation

Before you start, make sure you're logged into the CFX portal. This ensures you can download the asset and receive future updates.

### Downloading Dependencies

Dependencies are required before you start `op-mechanic`.

{% stepper %}
{% step %}

#### ox\_lib

{% embed url="<https://github.com/overextended/ox_lib>" %}
{% endstep %}

{% step %}

### fivem-freecam

{% embed url="<https://github.com/Deltanic/fivem-freecam>" %}
{% endstep %}

{% step %}

### flatbed (optional)

remove /flatbed.lua after installation!!!!!

{% embed url="<https://github.com/glitchdetector/fivem-functional-flatbed>" %}
{% endstep %}
{% endstepper %}

***

### Server.cfg

Start dependencies before our script. Framework and inventory must also be running.

```
ensure oxmysql
ensure ox_lib
ensure fivem-freecam
ensure fivem-functional-flatbed
ensure op-mechanic-props
ensure op-mechanic
```

***

### Database

On first start the script creates its own tables automatically (`ServerConfig.DisableAutoSql = false`).

{% hint style="info" %}
Set `ServerConfig.DisableAutoSql = true` in `config/ServerConfig.lua` only if you manage schema yourself.
{% endhint %}

***

### First Setup

{% stepper %}
{% step %}

#### Create items

{% content-ref url="/pages/7ab5HiN00BEt9PvNvSSW" %}
[Create Items](/scripts/op-mechanic-v2/create-items.md)
{% endcontent-ref %}
{% endstep %}

{% step %}

#### Grant Mechanic Admin

Follow How to add player to Mechanic Admin, then open `/mechanicadmin`.

{% content-ref url="/pages/evCQxsHbiLhEoqpNn66g" %}
[How to add player to Mechanic Admin](/scripts/op-mechanic-v2/tutorials/how-to-add-player-to-mechanic-admin.md)
{% endcontent-ref %}
{% endstep %}

{% step %}

#### Create a shop

Follow How to setup the first shop. Link a real framework job (for example `mechanic`).

{% content-ref url="/pages/Bf3W4uUaKXqq2HNNW6Qb" %}
[How to setup the first shop](/scripts/op-mechanic-v2/tutorials/how-to-setup-the-first-shop.md)
{% endcontent-ref %}
{% endstep %}

{% step %}

#### Configure locale / currency

Edit `config/MainConfig.lua` (`Config.Locale`, `Config.Currency`) and check other files listed in Config Files.
{% endstep %}
{% endstepper %}
