Installation

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)

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
    │   └── editable/
    ├── server/
    │   ├── server.lua
    │   └── editable/
    ├── sql/
    │   └── stress.sql
    └── images/
        ├── joint.png
        └── stress_pill.png

Step 3: Add to Server Config

Add the following to your server.cfg. Ensure dependencies start first:

ensure ox_lib
ensure qb-core   # or qbx_core or es_extended

ensure legends_stress
⚠️

Important: ox_lib 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.sql

Option 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 to your inventory system.

For ox_inventory

Add to ox_inventory/data/items.lua:

['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'
    }
}

For qb-inventory / qbx_core

Add to qb-core/shared/items.lua or qbx_core/shared/items.lua:

['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.'
}

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);

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
}

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.png
  • joint.png

Step 7: Configure (Optional)

Customize settings in config/config.lua. See the Configuration page for all options.

Step 8: Restart Server

Restart your server or use the refresh and ensure legends_stress commands.

Verification

After installation:

  1. Join the server and shoot a weapon - stress should increase
  2. Drive at high speed - stress should increase
  3. Use a stress pill or joint - stress should decrease with visual effects
  4. Check the console for any framework detection messages

Admin Commands

CommandUsageDescription
/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!


Legends Store - Premium FiveM Scripts