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

# Installation

Install RTX Minigolf on your server.

This guide covers the **complete installation process** of RTX Minigolf.

RTX Minigolf is a **standalone resource** and needs **no database**.

***

## Before You Start

* You bought RTX Minigolf on Tebex: <https://rtx.tebex.io/package/7811022>
* Ensure your server artifacts are up to date
* You downloaded the asset from the **CFX Asset Portal**

***

## Resource Setup

{% stepper %}
{% step %}

### Download

Download RTX Minigolf from:\
<https://portal.cfx.re/assets/granted-assets>
{% endstep %}

{% step %}

### Place resources into your server

Put both resources into your server resources folder, for example into `resources/[rtx]/`:

```
resources/
└── [rtx]/
    ├── rtx_minigolf_props
    └── rtx_minigolf
```

| Resource             | What it is                                                                                                                          |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `rtx_minigolf_props` | Track pieces, obstacles, the windmill and its animation, numbered flags, putting animations and the **Vespucci Beach Minigolf map** |
| `rtx_minigolf`       | The minigolf script itself                                                                                                          |

The models live in their own resource, so `rtx_minigolf` can be restarted at any time while the server runs - nobody has to reconnect.
{% endstep %}

{% step %}

### Add to server.cfg

```cfg
ensure rtx_minigolf_props
ensure rtx_minigolf

add_ace group.admin minigolf.admin allow
```

The `add_ace` line gives your admins the course creator and the admin commands.
{% endstep %}

{% step %}

### Set your framework

Open `config.lua`, section 1:

```lua
Config.Framework = "esx" -- "esx", "qbcore" or "standalone". QBox runs as "qbcore"

Config.MoneyAccount = "money" -- "money" (cash) or "bank"

Config.Language = "English"
```

| Framework          | Value          |
| ------------------ | -------------- |
| ESX                | `"esx"`        |
| QBCore             | `"qbcore"`     |
| QBox               | `"qbcore"`     |
| Standalone / other | `"standalone"` |

{% hint style="info" %}
In standalone mode every round is free and there are no stakes, unless you fill in the money functions in `server/other.lua`. The ESX and QBCore parts in the same file show how.
{% endhint %}
{% endstep %}

{% step %}

### Restart and play

Restart your server and go to **Vespucci Beach**. The minigolf ground with its 12-hole course is already there - walk to the first tee and press **E**.

Admins build new courses with:

```
/minigolfcreator
```

{% endstep %}
{% endstepper %}

{% hint style="info" %}
Next: [Your First Course](/rtxdev/rtx-minigolf/guides/your-first-course.md) - from `/minigolfcreator` to a playable course in a few minutes.
{% endhint %}

***

## Who Can Use the Creator

The course creator and the admin commands are for admins only. A player is an admin when **any** of these is true:

* the player has the ACE `minigolf.admin`
* the player's identifier is in `Config.Creator.identifiers`
* the player's ESX group or QBCore permission is in `Config.Creator.groups`

```lua
Config.AdminAce = "minigolf.admin"

Config.Creator = {
    groups = {"admin", "superadmin", "god"},
    identifiers = {},
}
```

The check is done on the server in `IsAdminRTX` in `server/other.lua`, so you can change it to anything you want.

***

## Items (Optional)

Only if you want them, `config.lua` section 15:

| Item              | What it does                                                                                 |
| ----------------- | -------------------------------------------------------------------------------------------- |
| `minigolf_putter` | With `required = true` only players with a putter can play. Using it opens the course finder |
| `minigolf_kit`    | Lets players build their own courses. Using it opens the course creator                      |

The `items` folder has them ready for **ox\_inventory**, **QBCore / QBox** (new and old item format) and the **ESX** database (`items/esx.sql`). See [Player Courses & Items](/rtxdev/rtx-minigolf/guides/player-courses-and-items.md).

***

## Target (Optional)

The script works with the key prompt out of the box. To use a target system, `config.lua` section 3:

```lua
Config.Target = true
Config.Targettype = "oxtarget" -- "oxtarget", "qbtarget" or "qtarget"
```

***

## Your Data

Everything is saved in `rtx_minigolf/data/`:

| File                               | What is in it                                       |
| ---------------------------------- | --------------------------------------------------- |
| `courses.json`                     | Courses built with the course creator and the trash |
| `templates.json`                   | Ready holes saved in game                           |
| `companies.json`                   | Earnings of courses run as a business               |
| `records_a.json`, `records_b.json` | Leaderboards, two copies written in turns           |

{% hint style="danger" %}
**Back up the `data` folder** with your server, and keep its files when you update the resource. Your courses and leaderboards are in it.
{% endhint %}

***

## Need Help?

If you get stuck during the installation, contact us on Discord and we will help you.

<a href="https://discord.gg/rtxdev" class="button primary">Join our Discord</a>
