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

# Installation

Install Cuxial Gym step by step: dependencies, inventory items, convars, staff permissions and start order.

Cuxial Gym comes as two folders, needs eight inventory items and creates its own database tables on first start.

{% stepper %}
{% step %}

## Check the dependencies

These resources must be installed and working before you add the gym:

* `ox_lib`
* `oxmysql`
* `cuxial_bridge`, with your framework
* `sleepless_interact`
* OneSync enabled on the server

`ox_inventory` is recommended: supplements, the daily reward, the shop, lockers and stashes go through the inventory.

`cuxial_appearance` is optional. When it is running, cloakroom points open its wardrobe. To use another clothing resource, point the cloakroom at it in `cloakroom.handlers`.
{% endstep %}

{% step %}

## Copy the resources

Place both folders inside your `resources` directory. Keep the folder names as they are.

* `cuxial_gym`
* `cuxial_gym_assets`

{% hint style="danger" %}
Cuxial Gym provides the resource name `CuxialGym`. A resource with that name must not run alongside it.
{% endhint %}
{% endstep %}

{% step %}

## Add the items

Copy the eight entries of `install/items.lua` into the item list of your inventory. With `ox_inventory`:

{% code title="ox\_inventory/data/items.lua" %}

```lua
['gym_iron_surge'] = {
    label = 'Iron Surge',
    weight = 0,
    stack = true,
    close = true,
    description = '+20% training XP for 1 hour',
},
```

{% endcode %}

The eight item names are `gym_iron_surge`, `gym_pump_juice`, `gym_ripped_recovery`, `gym_hardcore_stack`, `gym_beast_mode_fuel`, `gym_apex_predator`, `gym_american_mass` and `gym_king_of_iron`.

Add one image per item, named after the item, in `ox_inventory/web/images/<item>.webp`. The gym reads item images from that path; change `items.imageUrl` if yours live elsewhere.

{% hint style="info" %}
The items need no `client` or `server` block. The gym registers them as usable when it starts.
{% endhint %}
{% endstep %}

{% step %}

## Set the convars

All of them are optional.

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

```cfg
# Language (en and es are included)
setr ox:locale "en"

# Discord webhook for the gym logs
set cuxial_gym_webhook "https://discord.com/api/webhooks/..."

# Debug traces in the console
setr cuxial_gym_debug "0"
```

{% endcode %}

{% hint style="info" %}
The webhook goes in `server.cfg`, never in `shared/config.lua`. The name of the convar can be changed in `logs.convar`.
{% endhint %}
{% endstep %}

{% step %}

## Give staff access

Two ACE permissions open the staff editors. Players with the framework permission `admin` have both without any ACE.

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

```cfg
add_ace group.admin cuxial_gym.admin allow
add_ace group.admin cuxial_gym.creator allow
```

{% endcode %}

See [Commands & permissions](/scripts/leisure/cuxial-gym/commands.md) for what each one opens.
{% endstep %}

{% step %}

## Start the resources

Start the assets before the gym, and both after their dependencies and your framework:

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

```cfg
ensure ox_lib
ensure oxmysql
# your framework here
ensure ox_inventory
ensure sleepless_interact
ensure cuxial_bridge
# optional
ensure cuxial_appearance
ensure cuxial_gym_assets
ensure cuxial_gym
```

{% endcode %}

No SQL to run. The resource creates its seven `cuxial_gym_*` tables when it starts; `install/cuxial_gym.sql` is only a reference.

On the very first start, with no zones in the database, the gym also creates one sample zone with its equipment and points from `data/seed.lua`. From then on the database is the source of truth and zones are edited in game.
{% endstep %}

{% step %}

## Check that it works

1. Join the server and run `/gymcreator`. The zone editor opens and lists the sample zone.
2. Open the sample zone and teleport to one of its pieces of equipment from the editor. The equipment is in place.
3. Use the gym menu point. The panel opens with your stats and the membership tab. The sample zone does not require a pass; turn the requirement on in the editor if you want one.
4. Interact with a machine and start an exercise. The minigame appears; press <kbd>X</kbd> to leave the set.
5. Run `/gymadmin` and create a business, then assign the zone to it.
   {% endstep %}
   {% endstepper %}

Next: learn how each part is used in the [Features guide](/scripts/leisure/cuxial-gym/features.md), or adjust the script in [Configuration](/scripts/leisure/cuxial-gym/configuration.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cuxial.com/scripts/leisure/cuxial-gym/installation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
