Configuration
All configuration for legends_stress is done in the config/config.lua file.
Configuration File Structure
Location: config/config.lua
Config = {}
Config.Framework = "auto"
Config.Inventory = "auto"
Config.Notify = "auto"
Config.ProgressBar = "auto"
Config.Intensity = { ... }
Config.DecreaseStress = { ... }
Config.YogaMat = { ... }Framework & Integration Settings
Config.Framework
Config.Framework = "auto"Description: Determines which framework to use.
Type: string
Default: "auto"
Options:
| Value | Description |
|---|---|
"auto" | Automatically detects available framework |
"qb" | Force use QB-Core |
"qbx" | Force use QBX-Core |
"esx" | Force use ESX |
Config.Inventory
Config.Inventory = "auto"Description: Determines which inventory system to use for item management.
Type: string
Default: "auto"
Options: "auto", "ox", "qb", "esx"
Config.Notify
Config.Notify = "auto"Description: Determines which notification system to use.
Type: string
Default: "auto"
Options: "auto", "qb", "qbx", "esx", "ox_lib"
Config.ProgressBar
Config.ProgressBar = "auto"Description: Determines which progress bar system to use.
Type: string
Default: "auto"
Options: "auto", "qb", "qbx", "esx", "ox_lib"
Stress Effects Intensity
Config.Intensity
Controls how stress effects intensify based on stress level.
Blur Effect
Config.Intensity = {
['blur'] = {
{ min = 30, max = 49, duration = 15000, timeout = {min = 15000, max = 20000}},
{ min = 50, max = 59, duration = 1500, timeout = {min = 6000, max = 12000}},
{ min = 60, max = 69, duration = 1500, timeout = {min = 3500, max = 6000}},
{ min = 70, max = 79, duration = 1500, timeout = {min = 2500, max = 3500}},
{ min = 80, max = 89, duration = 1500, timeout = {min = 1500, max = 2500}},
{ min = 90, max = 100, duration = 1500, timeout = {min = 150, max = 200}},
},
}| Property | Type | Description |
|---|---|---|
min | number | Minimum stress level for this tier |
max | number | Maximum stress level for this tier |
duration | number | How long the blur effect lasts (ms) |
timeout.min | number | Minimum time between blur effects (ms) |
timeout.max | number | Maximum time between blur effects (ms) |
Screen Shake Effect
Config.Intensity = {
['shake'] = {
{ min = 60, max = 69, intensity = 0.03, timeout = {min = 3200, max = 3800}},
{ min = 70, max = 79, intensity = 0.04, timeout = {min = 2600, max = 3200}},
{ min = 80, max = 89, intensity = 0.05, timeout = {min = 1500, max = 2200}},
{ min = 90, max = 100, intensity = 0.06, timeout = {min = 850, max = 1200}},
},
}| Property | Type | Description |
|---|---|---|
min | number | Minimum stress level for this tier |
max | number | Maximum stress level for this tier |
intensity | number | Shake amplitude (0.01-0.1 recommended) |
timeout.min | number | Minimum time between shakes (ms) |
timeout.max | number | Maximum time between shakes (ms) |
Red Screen Effect
Config.Intensity = {
["redscreen"] = {
{ min = 80, max = 84, modifier = "REDMIST_blend", strength = 0.3},
{ min = 85, max = 89, modifier = "REDMIST_blend", strength = 0.4},
{ min = 90, max = 92, modifier = "REDMIST_blend", strength = 0.5},
{ min = 93, max = 95, modifier = "REDMIST_blend", strength = 0.6},
{ min = 96, max = 100, modifier = "REDMIST_blend", strength = 0.8},
}
}| Property | Type | Description |
|---|---|---|
min | number | Minimum stress level for this tier |
max | number | Maximum stress level for this tier |
modifier | string | Timecycle modifier name |
strength | number | Effect opacity (0.0-1.0) |
Heartbeat Sound Effect
Config.Intensity = {
["heartbeat"] = {
enabled = true,
minStress = 85,
loopInterval = 1500,
useCustomSound = true,
soundFile = "heartbeat.mp3",
soundVolume = 0.4,
soundSystem = "builtin",
}
}| Property | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable/disable heartbeat sound effect |
minStress | number | 85 | Minimum stress level to trigger heartbeat |
loopInterval | number | 1500 | Time between heartbeat sounds (ms) |
useCustomSound | boolean | true | Use custom sound file instead of native |
soundFile | string | "heartbeat.mp3" | Sound file name (place in html/sounds/ folder) |
soundVolume | number | 0.4 | Volume level (0.0 to 1.0) |
soundSystem | string | "builtin" | Sound system to use |
Sound System Options:
| Value | Description |
|---|---|
"builtin" | Built-in NUI sound player (no dependencies) |
"xsound" | Uses xsound resource |
"interact-sound" | Uses interact-sound resource |
The builtin sound system requires no additional resources. Simply place your sound file (MP3 or OGG) in the html/sounds/ folder.
Fallout Effect
Config.Intensity = {
["fallout"] = {
enabled = true,
minStress = 100,
duration = 5000,
cooldown = 20000,
}
}| Property | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable/disable ragdoll at max stress |
minStress | number | 100 | Stress level to trigger (100 = max stress) |
duration | number | 5000 | How long the ragdoll lasts (ms) |
cooldown | number | 20000 | Cooldown between fallout events (ms) |
The fallout effect causes players to ragdoll when stress reaches maximum. This can be disabled for servers that prefer less punishing mechanics.
Stress Gain Settings
Config.GainStressFromShooting
Config.GainStressFromShooting = true
Config.ShootingMulitiplier = 0.69GainStressFromShooting: Enable/disable stress gain from shooting weapons.
ShootingMultiplier: Amount of stress gained per shot.
Default: 0.69 stress per shot
Config.GainStressFromDriving
Config.GainStressFromDriving = true
Config.VehicleMulitiplier = 0.01GainStressFromDriving: Enable/disable stress gain from high-speed driving.
VehicleMultiplier: Stress gained based on vehicle speed.
Default: 0.01 (multiplied by speed)
Stress Relief Items
Config.DecreaseStress
Config.DecreaseStress = {
["stress_pill"] = {
value = 20,
progressbarduration = 5,
effectDuration = 35
},
["joint"] = {
value = 25,
progressbarduration = 5,
effectDuration = 35
}
}stress_pill
| Property | Type | Default | Description |
|---|---|---|---|
value | number | 20 | Total stress reduction (spread over duration) |
progressbarduration | number | 5 | Progress bar time in seconds |
effectDuration | number | 35 | Total duration of stress relief effect in seconds |
joint
| Property | Type | Default | Description |
|---|---|---|---|
value | number | 25 | Total stress reduction |
progressbarduration | number | 5 | Progress bar time in seconds |
effectDuration | number | 35 | Duration of visual effect in seconds |
Yoga Mat System
Config.YogaMat
Complete configuration for the yoga mat system.
Config.YogaMat = {
enabled = true,
-- Stress relief settings
stressRelief = 50,
yogaDuration = 30,
-- Mat behavior
matDespawnTime = 600,
pickupDistance = 2.0,
interactDistance = 1.5,
-- Placement settings
placementRange = 2.0,
-- Target system
targetSystem = "auto",
-- Yoga mat items
items = {
["mat_blue"] = "prop_yoga_mat_01",
["mat_gray"] = "prop_yoga_mat_02",
["mat_red"] = "prop_yoga_mat_03",
["mat_pro"] = "p_yoga_mat_01_s",
},
-- Animation settings
animations = {
placement = { dict = "anim@heists@narcotics@trash", anim = "drop_front" },
pickup = { dict = "anim@heists@narcotics@trash", anim = "pickup" },
yoga = { dict = "amb@world_human_yoga@female@base", anim = "base_a", flag = 1 }
},
-- Cooldown
cooldown = 60
}General Settings
| Property | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable/disable yoga mat system |
stressRelief | number | 50 | Amount of stress reduced per yoga session |
yogaDuration | number | 30 | Duration of yoga animation in seconds |
cooldown | number | 60 | Cooldown between yoga sessions in seconds |
Mat Behavior
| Property | Type | Default | Description |
|---|---|---|---|
matDespawnTime | number | 600 | Auto-despawn time in seconds (600 = 10 minutes) |
pickupDistance | number | 2.0 | Maximum distance to pick up a mat |
interactDistance | number | 1.5 | Maximum distance to interact with mat for yoga |
placementRange | number | 2.0 | Distance in front of player where mat is placed |
Target System
targetSystem = "auto"| Value | Description |
|---|---|
"auto" | Automatically detects ox_target or qb-target |
"ox_target" | Force use ox_target |
"qb-target" | Force use qb-target |
A target system (ox_target or qb-target) is required for yoga mat interactions. The resource will not function properly without one.
Yoga Mat Items
Maps inventory item names to their corresponding prop models:
items = {
["mat_blue"] = "prop_yoga_mat_01", -- Blue yoga mat
["mat_gray"] = "prop_yoga_mat_02", -- Gray yoga mat
["mat_red"] = "prop_yoga_mat_03", -- Red yoga mat
["mat_pro"] = "p_yoga_mat_01_s", -- Professional yoga mat
}| Item Name | Prop Model | Description |
|---|---|---|
mat_blue | prop_yoga_mat_01 | Blue colored yoga mat |
mat_gray | prop_yoga_mat_02 | Gray colored yoga mat |
mat_red | prop_yoga_mat_03 | Red colored yoga mat |
mat_pro | p_yoga_mat_01_s | Professional-grade yoga mat |
Animations
Customize the animations used during yoga mat interactions:
animations = {
placement = {
dict = "anim@heists@narcotics@trash",
anim = "drop_front"
},
pickup = {
dict = "anim@heists@narcotics@trash",
anim = "pickup"
},
yoga = {
dict = "amb@world_human_yoga@female@base",
anim = "base_a",
flag = 1 -- 1 = loop animation
}
}| Animation | Dictionary | Name | Description |
|---|---|---|---|
placement | anim@heists@narcotics@trash | drop_front | Played when placing mat |
pickup | anim@heists@narcotics@trash | pickup | Played when picking up mat |
yoga | amb@world_human_yoga@female@base | base_a | Looped during yoga session |
Admin & Debug
Config.EnableAdminCommands
Config.EnableAdminCommands = falseDescription: Enables the /setstress admin command.
Type: boolean
Default: false
Command usage: /setstress [playerId] [stressLevel]
Config.EnableDebug
Config.EnableDebug = falseDescription: Enables debug console output.
Type: boolean
Default: false
Config.Wait
Config.Wait = 10Description: Interval between stress level checks in milliseconds.
Type: number
Default: 10
Keep this at 10ms for smooth gameplay. Higher values may cause noticeable delays in effects.
Example Configurations
Hardcore Server (High Stress)
Config.GainStressFromShooting = true
Config.ShootingMulitiplier = 1.5 -- More stress from shooting
Config.GainStressFromDriving = true
Config.VehicleMulitiplier = 0.05 -- More stress from driving
Config.Intensity["fallout"] = {
enabled = true,
minStress = 100,
duration = 8000, -- Longer ragdoll
cooldown = 10000, -- More frequent fallouts
}
Config.Intensity["heartbeat"] = {
enabled = true,
minStress = 75, -- Starts earlier
loopInterval = 1000, -- Faster heartbeat
soundVolume = 0.6, -- Louder
}
Config.YogaMat.stressRelief = 30 -- Less relief from yoga
Config.YogaMat.cooldown = 120 -- Longer cooldownCasual Server (Low Stress)
Config.GainStressFromShooting = true
Config.ShootingMulitiplier = 0.3 -- Less stress from shooting
Config.GainStressFromDriving = false -- Disable driving stress
Config.Intensity["fallout"] = {
enabled = false, -- Disable ragdoll at 100%
}
Config.Intensity["heartbeat"] = {
enabled = true,
minStress = 95, -- Only at very high stress
soundVolume = 0.3, -- Quieter
}
Config.DecreaseStress = {
["stress_pill"] = { value = 40, progressbarduration = 3, effectDuration = 20 },
["joint"] = { value = 50, progressbarduration = 3, effectDuration = 20 }
}
Config.YogaMat.stressRelief = 75 -- More relief from yoga
Config.YogaMat.cooldown = 30 -- Shorter cooldownRoleplay Server (Balanced)
Config.GainStressFromShooting = true
Config.ShootingMulitiplier = 0.5
Config.GainStressFromDriving = true
Config.VehicleMulitiplier = 0.005 -- Minimal driving stress
Config.Intensity["heartbeat"] = {
enabled = true,
minStress = 85,
loopInterval = 2000, -- Slower, more realistic
soundVolume = 0.35,
}
Config.YogaMat.enabled = true
Config.YogaMat.stressRelief = 50
Config.YogaMat.yogaDuration = 45 -- Longer yoga sessions
Config.YogaMat.cooldown = 90Need Help?
Join our Discord for support: discord.gg/lgnds (opens in a new tab)