Rarx Gym
Rarx Gym
Deep training system with trainable stats, workout minigames, supplements, memberships and an ownable gym business
- Qbox
- QBCore
- ESX
rarx_gym
Overview#
RARX Gym is a complete fitness and training system for FiveM. Players build five trainable stats through machine workouts and free-zone exercises, manage fatigue and stress, buy timed supplement buffs, and progress through achievements, daily tasks and a global leaderboard. Each gym is also an ownable business with memberships, payroll and an employee roster. Built with a Vue NUI, multi-framework support and the RARX locale system.
Features#
Auto-detection for QBCore, QBox (qbx_core), ESX and standalone
Power, Durability, Energy, Healthy and Boxer — each tied to specific machines
Bench, biceps, squat, abs, back, shoulders, cardio and endurance minigames
Soft/hard caps throttle gains as you tire, with recovery over time
Protein, Pre-workout and Creatine — timed buffs that boost gains and cut fatigue
Ownable gyms with boss/employee roles, a management panel and payroll
Weekly and monthly membership plans sold to players
Unlockable achievements and rotating daily tasks
Phone-style app with global leaderboard, notifications and events
Sprinting trains Energy; landing melee hits trains Boxer (anti-farm capped)
Stop training and stats slowly decay, with an optional visual overlay
Optional system that changes the player's face when they stop training
Requirements#
| Requirement | Type |
|---|---|
| oxmysql | Required |
| QBCore / QBox / ESX | Required (auto-detected) |
| ox_lib | Required |
| rarx_lib | Required (locale/translation helper) |
| ox_target / qb-target | Optional (for target interaction mode) |
Installation#
Download & Extract
Extract the resource into your resources folder.
Add Supplement Items
Add
gym_protein,gym_preworkoutandgym_creatineto your inventory (see Items section below).Add to server.cfg
ensure ox_lib ensure rarx_lib ensure rarx_gymSet Language
setr rarx-lang "en"Configure
Edit the files in
config/to customize gyms, supplements, stats and commands.
Items#
Add to qb-core/shared/items.lua:
['gym_protein'] = {['name'] = 'gym_protein', ['label'] = 'Protein', ['weight'] = 200, ['type'] = 'item', ['image'] = 'gym_protein.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['description'] = 'Boosts training gains'},
['gym_preworkout'] = {['name'] = 'gym_preworkout', ['label'] = 'Pre-workout', ['weight'] = 200, ['type'] = 'item', ['image'] = 'gym_preworkout.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['description'] = 'Reduces fatigue and stress'},
['gym_creatine'] = {['name'] = 'gym_creatine', ['label'] = 'Creatine', ['weight'] = 200, ['type'] = 'item', ['image'] = 'gym_creatine.png', ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['description'] = 'Saves stamina and speeds recovery'},Add to ox_inventory/data/items.lua:
['gym_protein'] = { label = 'Protein', weight = 200, stack = true, close = true },
['gym_preworkout'] = { label = 'Pre-workout', weight = 200, stack = true, close = true },
['gym_creatine'] = { label = 'Creatine', weight = 200, stack = true, close = true },Run this SQL query:
INSERT INTO `items` (`name`, `label`, `weight`) VALUES
('gym_protein', 'Protein', 200),
('gym_preworkout', 'Pre-workout', 200),
('gym_creatine', 'Creatine', 200);Configuration#
Core Settings#
Config.Framework = 'auto' -- 'esx', 'qb', 'auto' or 'standalone'
Config.System = 'target' -- 'press' or 'target' (ox_target / qb-target)
Config.Notify = { Notification = 'ox_lib' }
Config.UseVanillaProps = false -- false = animated RX machine pack, true = vanilla GTA props onlyStats#
Each machine targets one stat, and stats feed back into gameplay:
| Stat | Trained by | In-game effect |
|---|---|---|
| Power | Bench, presses, curls | More melee / unarmed damage |
| Durability | Squats, leg press, back | Reduced incoming damage |
| Energy | Treadmill, bike, sprinting | Larger stamina pool |
| Healthy | Sit-ups, yoga | Passive health regen |
| Boxer | Speed bag, punching bag, melee hits | More melee / unarmed damage |
Fatigue & Stress#
Config.Fatigue = { Max = 100.0, PerRep = 3.0, SoftCap = 70.0, HardCap = 95.0, ... }
Config.Stress = { Max = 100.0, PerRep = 1.0, SoftCap = 75.0, HardCap = 100.0, ... }Reps build fatigue and stress; once you cross the soft/hard caps your gains are reduced, so you can't farm endlessly. Both recover while you rest.
Gyms#
Three gyms ship pre-configured — Muscle Sands (Vespucci Beach), Shores and Paleto — each with a supplement NPC and an ownable business. Add as many as you like:
Config.Gyms = {
{
id = "vespucci",
name = "MUSCLE SANDS GYM",
coords = vec3(-1202.00, -1563.00, 4.61),
rating = 4,
shop = {
coords = vec4(-1196.28, -1576.19, 4.61, 128.39),
pedModel = `a_m_y_stbla_01`,
label = "Buy supplements",
},
business = {
enabled = true,
job = "gym_vespucci",
adminRoles = { "boss" },
membershipPrice = { weekly = 500, monthly = 1500 },
membershipDays = { weekly = 7, monthly = 30 },
},
},
-- shores, paleto ...
}Supplements#
Config.Supplements = {
{ key = "protein", itemName = "gym_protein", price = 150, durationMin = 60, gainMultiplier = 1.5 },
{ key = "preworkout", itemName = "gym_preworkout", price = 180, durationMin = 45, stressReduction = 0.25, fatigueReduction = 0.30 },
{ key = "creatine", itemName = "gym_creatine", price = 200, durationMin = 90, staminaSave = 0.4, recoveryBoost = 1.4 },
}World Activities#
Config.WorldActivities = {
Enabled = true,
Sprint = { Enabled = true, MinSpeed = 4.0, TickMs = 4000, EnergyGain = 0.5 }, -- trains Energy
Combat = { Enabled = true, PvPOnly = true, CooldownMs = 600, BoxerGain = 1.0 }, -- trains Boxer
}Ped Fatness (Optional)#
Config.PedFat = {
Enabled = false, -- when on, neglecting training gradually changes the face through 5 variations
AdvanceMs = 60 * 60 * 1000,
}Commands#
| Command | Description |
|---|---|
/gym |
Open the personal stats / progression screen |
/resetstatistics |
Reset a player's stats (admin) |
/resetaccount |
Reset a player's gym account (admin) |
Admin permission groups are defined in Config.Commands.permissions (ACE plus per-framework groups).
Exports#
-- Stats & session (client)
exports['rarx_gym']:GetCachedStats() -- current stat values
exports['rarx_gym']:GetFatigue() -- current fatigue
exports['rarx_gym']:GetStress() -- current stress
exports['rarx_gym']:CanTrain() -- whether the player may train right now
exports['rarx_gym']:IsSessionActive() -- in an active workout?
exports['rarx_gym']:IsReboundActive() -- is decay/rebound applying?
-- Busy state (client) — useful for other scripts
exports['rarx_gym']:IsRarxGymMachineBusy() -- on a machine?
exports['rarx_gym']:IsRarxGymFreeZoneBusy() -- doing a free-zone exercise?
-- Supplements (client)
exports['rarx_gym']:HasActiveSupplementLocal()
exports['rarx_gym']:GetCachedSupplements()Localization#
Set the language with the rarx-lang convar (shared by all RARX scripts):
setr rarx-lang "es" # default: "en"Available languages: en, es, fr, de, it, pt. Translations live in translates/ and use the RARX Lang (Locale) system — copy en.lua to add or edit a language.
Troubleshooting#
Machines / NPC not appearing
Check the gym coordinates in config/settings.lua and make sure no other script is deleting objects/peds in that area.
Supplements do nothing
Verify the items exist in your inventory and the names match Config.Supplements (gym_protein, gym_preworkout, gym_creatine).
Can't open the stats screen
The default command is /gym (Config.Commands.stats). Make sure it isn't overridden by another resource.
Wrong language
Set setr rarx-lang "es" (or another supported code) in server.cfg and restart the resource.
Stats not saving
Confirm oxmysql is running and started before rarx_gym; the rarx_gym_* tables are created automatically on boot.
Support#
Need help? Reach out:
- Discord: discord.gg/rarxnetwork
- Store: rarxnetwork.com
