Orbit StudiosOrbit Studios
Orbit Studios Resourcesorbit-dynamichud-stress

Events

Stress state bags and server events available in orbit-dynamichud-stress.

Events

Stress is stored as a replicated state bag value from 0 to 100.

Use the server events when you want the stress resource to handle clamping and whitelist checks. Read the state bag when you only need to display or react to the current value.

resources/[custom]/client/main.lua
local stress = LocalPlayer.state.stress or 0
resources/[custom]/server/main.lua
local src = source
local stress = Player(src)?.state?.stress or 0

Player(src)?.state:set("stress", 25, true)

Prop

Type

Client Integration

resources/[custom]/client/main.lua
TriggerServerEvent('hud:server:GainStress', 10)
TriggerServerEvent('hud:server:RelieveStress', 15)

Use client triggers for gameplay actions that happen locally, such as a minigame failure, consuming an item, or a custom vehicle script detecting stressful behavior.

Server-Side Admin Or Script Integration

resources/[custom]/server/main.lua
local src = 12
local stress = math.max(0, math.min(100, 25))

Player(src)?.state:set("stress", stress, true)

Use direct state writes when server code already knows the target player ID, such as an admin command or another server-only system. Clamp the value yourself so it stays between 0 and 100.

hud:server:GainStress clamps at 100. hud:server:RelieveStress clamps at 0. hud:server:GainStress also checks Config.Stress.whitelistedJobs.

On this page