Configuration

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:

ValueDescription
"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}},
    },
}
PropertyTypeDescription
minnumberMinimum stress level for this tier
maxnumberMaximum stress level for this tier
durationnumberHow long the blur effect lasts (ms)
timeout.minnumberMinimum time between blur effects (ms)
timeout.maxnumberMaximum 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}},
    },
}
PropertyTypeDescription
minnumberMinimum stress level for this tier
maxnumberMaximum stress level for this tier
intensitynumberShake amplitude (0.01-0.1 recommended)
timeout.minnumberMinimum time between shakes (ms)
timeout.maxnumberMaximum 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},
    }
}
PropertyTypeDescription
minnumberMinimum stress level for this tier
maxnumberMaximum stress level for this tier
modifierstringTimecycle modifier name
strengthnumberEffect 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",
    }
}
PropertyTypeDefaultDescription
enabledbooleantrueEnable/disable heartbeat sound effect
minStressnumber85Minimum stress level to trigger heartbeat
loopIntervalnumber1500Time between heartbeat sounds (ms)
useCustomSoundbooleantrueUse custom sound file instead of native
soundFilestring"heartbeat.mp3"Sound file name (place in html/sounds/ folder)
soundVolumenumber0.4Volume level (0.0 to 1.0)
soundSystemstring"builtin"Sound system to use

Sound System Options:

ValueDescription
"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,
    }
}
PropertyTypeDefaultDescription
enabledbooleantrueEnable/disable ragdoll at max stress
minStressnumber100Stress level to trigger (100 = max stress)
durationnumber5000How long the ragdoll lasts (ms)
cooldownnumber20000Cooldown 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.69

GainStressFromShooting: 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.01

GainStressFromDriving: 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

PropertyTypeDefaultDescription
valuenumber20Total stress reduction (spread over duration)
progressbardurationnumber5Progress bar time in seconds
effectDurationnumber35Total duration of stress relief effect in seconds

joint

PropertyTypeDefaultDescription
valuenumber25Total stress reduction
progressbardurationnumber5Progress bar time in seconds
effectDurationnumber35Duration 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

PropertyTypeDefaultDescription
enabledbooleantrueEnable/disable yoga mat system
stressReliefnumber50Amount of stress reduced per yoga session
yogaDurationnumber30Duration of yoga animation in seconds
cooldownnumber60Cooldown between yoga sessions in seconds

Mat Behavior

PropertyTypeDefaultDescription
matDespawnTimenumber600Auto-despawn time in seconds (600 = 10 minutes)
pickupDistancenumber2.0Maximum distance to pick up a mat
interactDistancenumber1.5Maximum distance to interact with mat for yoga
placementRangenumber2.0Distance in front of player where mat is placed

Target System

targetSystem = "auto"
ValueDescription
"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 NameProp ModelDescription
mat_blueprop_yoga_mat_01Blue colored yoga mat
mat_grayprop_yoga_mat_02Gray colored yoga mat
mat_redprop_yoga_mat_03Red colored yoga mat
mat_prop_yoga_mat_01_sProfessional-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
    }
}
AnimationDictionaryNameDescription
placementanim@heists@narcotics@trashdrop_frontPlayed when placing mat
pickupanim@heists@narcotics@trashpickupPlayed when picking up mat
yogaamb@world_human_yoga@female@basebase_aLooped during yoga session

Admin & Debug

Config.EnableAdminCommands

Config.EnableAdminCommands = false

Description: Enables the /setstress admin command.

Type: boolean

Default: false

Command usage: /setstress [playerId] [stressLevel]

Config.EnableDebug

Config.EnableDebug = false

Description: Enables debug console output.

Type: boolean

Default: false

Config.Wait

Config.Wait = 10

Description: 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 cooldown

Casual 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 cooldown

Roleplay 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 = 90

Need Help?

Join our Discord for support: discord.gg/lgnds (opens in a new tab)


Legends Store - Premium FiveM Scripts