Installation
Requirements
Required
- Your chosen framework (QB-Core, QBX-Core, or ESX)
- Your chosen inventory system (ox_inventory, qb-inventory, or esx_inventory)
- ox_lib (for progress bars and UI)
Optional
- oxmysql (required for ESX database operations)
- ox_target or qb-target (required for yoga mat interactions)
The yoga mat feature requires a target system (ox_target or qb-target). The resource will auto-detect which one is available.
Installation Steps
Step 1: Download the Resource
Download legends_stress from your Keymaster grants or the store.
Step 2: Extract to Resources
Place the legends_stress folder into your server's resources directory.
resources/
└── legends_stress/
├── fxmanifest.lua
├── config/
│ └── config.lua
├── client/
│ ├── client.lua
│ ├── gain.lua
│ ├── pills.lua
│ ├── yoga.lua
│ └── editable/
│ └── target.lua
├── server/
│ ├── server.lua
│ ├── yoga.lua
│ └── editable/
├── html/
│ ├── index.html
│ └── sounds/
│ └── heartbeat.mp3 (optional)
├── sql/
│ └── stress.sql
└── images/
├── joint.png
├── stress_pill.png
├── mat_blue.png
├── mat_gray.png
├── mat_red.png
└── mat_pro.pngStep 3: Add to Server Config
Add the following to your server.cfg. Ensure dependencies start first:
ensure ox_lib
ensure ox_target # or qb-target (required for yoga mats)
ensure qb-core # or qbx_core or es_extended
ensure legends_stressImportant: ox_lib, your target system, and your framework must start before legends_stress.
Step 4: Database Setup (ESX Only)
QB-Core and QBX-Core users can skip this step. These frameworks use built-in player metadata to store stress levels.
For ESX, import the SQL file to create the stress table:
Option 1: Import the file
mysql -u your_username -p your_database < sql/stress.sqlOption 2: Run the SQL manually
CREATE TABLE IF NOT EXISTS `player_stress` (
`identifier` varchar(50) NOT NULL,
`stress` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`identifier`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;Step 5: Add Items to Inventory
You must add the stress relief items and yoga mats to your inventory system.
For ox_inventory
Add to ox_inventory/data/items.lua:
Stress Relief Items:
['stress_pill'] = {
label = 'Stress Pills',
weight = 100,
stack = true,
close = true,
description = 'Medication to relieve stress and anxiety.',
server = {
export = 'legends_stress.useStressPill'
}
},
['joint'] = {
label = 'Joint',
weight = 50,
stack = true,
close = true,
description = 'A rolled joint for relaxation. Helps reduce stress.',
server = {
export = 'legends_stress.useJoint'
}
},Yoga Mat Items:
['mat_blue'] = {
label = 'Blue Yoga Mat',
weight = 500,
stack = false,
close = true,
description = 'A comfortable blue yoga mat for stress relief sessions.',
server = {
export = 'legends_stress.useMatBlue'
}
},
['mat_gray'] = {
label = 'Gray Yoga Mat',
weight = 500,
stack = false,
close = true,
description = 'A sleek gray yoga mat for stress relief sessions.',
server = {
export = 'legends_stress.useMatGray'
}
},
['mat_red'] = {
label = 'Red Yoga Mat',
weight = 500,
stack = false,
close = true,
description = 'A vibrant red yoga mat for stress relief sessions.',
server = {
export = 'legends_stress.useMatRed'
}
},
['mat_pro'] = {
label = 'Pro Yoga Mat',
weight = 500,
stack = false,
close = true,
description = 'A professional-grade yoga mat for the ultimate stress relief.',
server = {
export = 'legends_stress.useMatPro'
}
},For qb-inventory / qbx_core
Add to qb-core/shared/items.lua or qbx_core/shared/items.lua:
Stress Relief Items:
['stress_pill'] = {
name = 'stress_pill',
label = 'Stress Pills',
weight = 100,
type = 'item',
image = 'stress_pill.png',
unique = false,
useable = true,
shouldClose = true,
combinable = nil,
description = 'Medication to relieve stress and anxiety.'
},
['joint'] = {
name = 'joint',
label = 'Joint',
weight = 50,
type = 'item',
image = 'joint.png',
unique = false,
useable = true,
shouldClose = true,
combinable = nil,
description = 'A rolled joint for relaxation. Helps reduce stress.'
},Yoga Mat Items:
['mat_blue'] = {
name = 'mat_blue',
label = 'Blue Yoga Mat',
weight = 500,
type = 'item',
image = 'mat_blue.png',
unique = false,
useable = true,
shouldClose = true,
combinable = nil,
description = 'A comfortable blue yoga mat for stress relief sessions.'
},
['mat_gray'] = {
name = 'mat_gray',
label = 'Gray Yoga Mat',
weight = 500,
type = 'item',
image = 'mat_gray.png',
unique = false,
useable = true,
shouldClose = true,
combinable = nil,
description = 'A sleek gray yoga mat for stress relief sessions.'
},
['mat_red'] = {
name = 'mat_red',
label = 'Red Yoga Mat',
weight = 500,
type = 'item',
image = 'mat_red.png',
unique = false,
useable = true,
shouldClose = true,
combinable = nil,
description = 'A vibrant red yoga mat for stress relief sessions.'
},
['mat_pro'] = {
name = 'mat_pro',
label = 'Pro Yoga Mat',
weight = 500,
type = 'item',
image = 'mat_pro.png',
unique = false,
useable = true,
shouldClose = true,
combinable = nil,
description = 'A professional-grade yoga mat for the ultimate stress relief.'
},For ESX Inventory
Database method:
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
('stress_pill', 'Stress Pills', 1, 0, 1),
('joint', 'Joint', 1, 0, 1),
('mat_blue', 'Blue Yoga Mat', 5, 0, 1),
('mat_gray', 'Gray Yoga Mat', 5, 0, 1),
('mat_red', 'Red Yoga Mat', 5, 0, 1),
('mat_pro', 'Pro Yoga Mat', 5, 0, 1);Or items.lua method:
['stress_pill'] = {
label = 'Stress Pills',
weight = 100,
stack = true,
close = true,
description = 'Medication to relieve stress and anxiety.',
consume = 1
},
['joint'] = {
label = 'Joint',
weight = 50,
stack = true,
close = true,
description = 'A rolled joint for relaxation.',
consume = 1
},
['mat_blue'] = {
label = 'Blue Yoga Mat',
weight = 500,
stack = false,
close = true,
description = 'A comfortable blue yoga mat for stress relief sessions.',
consume = 0
},
['mat_gray'] = {
label = 'Gray Yoga Mat',
weight = 500,
stack = false,
close = true,
description = 'A sleek gray yoga mat for stress relief sessions.',
consume = 0
},
['mat_red'] = {
label = 'Red Yoga Mat',
weight = 500,
stack = false,
close = true,
description = 'A vibrant red yoga mat for stress relief sessions.',
consume = 0
},
['mat_pro'] = {
label = 'Pro Yoga Mat',
weight = 500,
stack = false,
close = true,
description = 'A professional-grade yoga mat for the ultimate stress relief.',
consume = 0
},Step 6: Add Item Images
Copy the images from the images/ folder to your inventory's image folder:
- ox_inventory:
ox_inventory/web/images/ - qb-inventory:
qb-inventory/html/images/ - esx_inventory: Your inventory's image folder
Images included:
stress_pill.pngjoint.pngmat_blue.pngmat_gray.pngmat_red.pngmat_pro.png
Step 7: Custom Heartbeat Sound (Optional)
To use a custom heartbeat sound:
- Place your audio file (MP3 or OGG) in
legends_stress/html/sounds/ - Name it
heartbeat.mp3(or update the config with your filename) - The sound will play at 85%+ stress
The resource includes a built-in NUI sound player. No external sound resources (like xsound or interact-sound) are required, but they are supported if you prefer.
Step 8: Configure (Optional)
Customize settings in config/config.lua. See the Configuration page for all options.
Step 9: Restart Server
Restart your server or use the refresh and ensure legends_stress commands.
Verification
After installation:
- Join the server and shoot a weapon - stress should increase
- Drive at high speed - stress should increase
- Use a stress pill or joint - stress should decrease with visual effects
- Place a yoga mat and use it - stress should decrease after yoga session
- Check the console for any framework detection messages
Admin Commands
| Command | Usage | Description |
|---|---|---|
/setstress | /setstress [playerId] [level] | Set a player's stress level (0-100) |
Admin commands require Config.EnableAdminCommands = true in config.
Need help? Join our Discord (opens in a new tab) and open a support ticket!