> 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/gym-system.md). Agents can also search and read this documentation through its [MCP server](https://rtx-dev.gitbook.io/rtxdev/~gitbook/mcp).

# Gym System

Documentation for RTX Gym System, the FiveM Gym Script for ESX, QBCore and QBox: installation, configuration, commands, exports and FAQ.

{% embed url="<https://www.youtube.com/watch?v=XfhrljSg2cY>" %}

## Purchase

[Purchase this resource](https://rtx.tebex.io/package/5658662)

## Installation

{% hint style="info" %}
**Framework compatibility**

This resource is **standalone** and works on any FiveM server.

Compatible with **ESX**, **QBCore**, **QBox**, **vRP**, and other frameworks.

If you are using a framework other than ESX, QBCore, or QBox, follow the **Standalone** installation instructions.
{% endhint %}

### Standalone

{% stepper %}
{% step %}

### Put files in resources

Put the `rtx_gym` folder into your resources.
{% endstep %}

{% step %}

### Configure

Open `config.lua` and configure it to your preferences.
{% endstep %}

{% step %}

### Database

Upload `sql_STANDALONE-QBCORE.sql` file to your MySQL database.
{% endstep %}

{% step %}

### fxmanifest.lua

Open `fxmanifest.lua` and edit it as shown in this screenshot: <https://i.imgur.com/LWaYxz7.png> — remove `--` from line 11, or replace line 11 with:

'@oxmysql/lib/MySQL.lua',
{% endstep %}

{% step %}

### server.cfg

Put the `rtx_gym` into your `server.cfg`.
{% endstep %}
{% endstepper %}

### QBCore

{% stepper %}
{% step %}

### Put files in resources

Put the `rtx_gym` folder into your resources.
{% endstep %}

{% step %}

### Configure framework

Open `config.lua` and replace:

Config.Framework = "standalone"

with

Config.Framework = "qbcore"
{% endstep %}

{% step %}

### Configure

Configure your `config.lua` to your preferences.
{% endstep %}

{% step %}

### Database

Upload `sql_STANDALONE-QBCORE.sql` file to your MySQL database.
{% endstep %}

{% step %}

### fxmanifest.lua

Open `fxmanifest.lua` and edit it as shown in this screenshot: <https://i.imgur.com/LWaYxz7.png> — remove `--` from line 11, or replace line 11 with:

'@oxmysql/lib/MySQL.lua',
{% endstep %}

{% step %}

### server.cfg

Put the `rtx_gym` into your `server.cfg`.
{% endstep %}

{% step %}

{% endstep %}

{% step %}

### Add items

{% endstep %}

{% step %}
Add new items to `qb-core/shared/items.lua` — items names: `protein`, `creatine`, `preworkout`, `testosterone`
{% endstep %}

{% step %}
Example items lines for `items.lua`:
{% endstep %}

{% step %}
\['protein'] = {\['name'] = 'protein', \['label'] = 'Protein', \['weight'] = 1000, \['type'] = 'item', \['image'] = 'protein.png', \['unique'] = false, \['useable'] = true, \['shouldClose'] = true, \['combinable'] = nil, \['description'] = 'Protein'}, \['creatine'] = {\['name'] = 'creatine', \['label'] = 'Creatine', \['weight'] = 1000, \['type'] = 'item', \['image'] = 'creatine.png', \['unique'] = false, \['useable'] = true, \['shouldClose'] = true, \['combinable'] = nil, \['description'] = 'Creatine'}, \['preworkout'] = {\['name'] = 'preworkout', \['label'] = 'Preworkout', \['weight'] = 1000, \['type'] = 'item', \['image'] = 'preworkout.png', \['unique'] = false, \['useable'] = true, \['shouldClose'] = true, \['combinable'] = nil, \['description'] = 'Preworkout'}, \['testosterone'] = {\['name'] = 'testosterone', \['label'] = 'Testosterone', \['weight'] = 1000, \['type'] = 'item', \['image'] = 'testosterone.png', \['unique'] = false, \['useable'] = true, \['shouldClose'] = true, \['combinable'] = nil, \['description'] = 'Testosterone'},
{% endstep %}
{% endstepper %}

### ESX

{% stepper %}
{% step %}

### Put files in resources

Put the `rtx_gym` folder into your resources.
{% endstep %}

{% step %}

### Configure framework

Open `config.lua` and replace:

Config.Framework = "standalone"

with

Config.Framework = "esx"
{% endstep %}

{% step %}

### Configure

Configure your `config.lua` to your preferences.
{% endstep %}

{% step %}

### Database

Upload `sql_ESX.sql` file to your MySQL database.
{% endstep %}

{% step %}

### fxmanifest.lua

Open `fxmanifest.lua` and edit it as shown in this screenshot: <https://i.imgur.com/yoULcX4.png> — remove `--` from line 10, or replace line 10 with:

'@mysql-async/lib/MySQL.lua',
{% endstep %}

{% step %}

### server.cfg

Put the `rtx_gym` into your `server.cfg`.
{% endstep %}
{% endstepper %}

## Maps

* Los Santos GYM\
  <https://www.gta5-mods.com/maps/mlo-interior-los-santos-gym>
* Pump & Run GYM\
  <https://www.gta5-mods.com/maps/mlo-pump-run-gym-add-on-sp-fivem-ragemp>
* La Fitness\
  <https://www.youtube.com/watch?v=LXm9ix0fF4Y>'

## Admin commands

* /addgymstats - example: /addgymstats 1 condition 25.0
* /removegymstats - example: /removegymstats 1 condition 25.0
* /statsgymclear - example: /statsgymclear 1

## Exports

#### Server - SavePlayer

```lua
exports["rtx_gym"]:SavePlayer(source)
```

***

#### Server - AddStats

```lua
exports["rtx_gym"]:AddStats(source, "condition", 25.0)
```

***

#### Server - RemoveStats

```lua
exports["rtx_gym"]:RemoveStats(source, "condition", 25.0)
```

***

#### Server - UpdateStats

```lua
exports["rtx_gym"]:UpdateStats(source, "condition", 25.0)
```

***

#### Server - GetStats

```lua
exports["rtx_gym"]:GetStats(source, "condition")
```

***

#### Server - GetAllStats

```lua
exports["rtx_gym"]:GetAllStats(source)
```

***

#### Client - GetStats

```lua
exports["rtx_gym"]:GetStats("condition")
```

***

#### Client - GetAllStats

```lua
exports["rtx_gym"]:GetAllStats()
```

<details>

<summary>Anticheat Object Whitelist</summary>

The following object names should be whitelisted in your anticheat configuration:

```

prop_barbell_10kg
prop_barbell_100kg
prop_barbell_80kg
prop_barbell_60kg
prop_barbell_50kg
prop_barbell_40kg
prop_barbell_30kg
prop_barbell_20kg
prop_curl_bar_01
prop_barbell_01
prop_ld_flow_bottle
prop_cs_pills
p_syringe_01_s

```

</details>

## Notes

This page contains simple installation instructions only.

More detailed instructions, exports, events and developer-related information can be found directly inside the product folder after downloading the resource from the CFX Asset Portal.

## Support

If you need help with installation, configuration or have any questions regarding this resource, feel free to contact us on our Discord server:

[Join our Discord](https://discord.gg/rtxdev)
