# Configuration (/docs/orbit-studios-resources/orbit-dynamichud-stress/configuration)



# Configuration [#configuration]

All public stress behavior lives in `resources/[orbit]/orbit-dynamichud-stress/config.lua`.

Stress is stored from `0` to `100`. The client can add stress from speeding and weapon usage, while server events can add or remove stress from other integrations.

<TypeTable
  type="{
  'Config.Stress.enable': {
    type: 'boolean',
    default: 'true',
    description: 'Enables or disables the stress system.',
  },
  'Config.Stress.chance': {
    type: 'number',
    default: '0.1',
    description: 'Chance from 0 to 1 that shooting adds stress.',
  },
  'Config.Stress.stressSpeedFormat': {
    type: '&#x22;kmh&#x22; | &#x22;mph&#x22;',
    default: '&#x22;kmh&#x22;',
    description: 'Speed unit used by the speeding thresholds.',
  },
  'Config.Stress.minForShaking': {
    type: 'number',
    default: '50',
    description: 'Minimum stress value before blur/shaking effects can run.',
  },
  'Config.Stress.minForSpeeding': {
    type: 'number',
    default: '1000',
    description: 'Speed threshold while buckled, and also the motorcycle threshold.',
  },
  'Config.Stress.minForSpeedingUnbuckled': {
    type: 'number',
    default: '50',
    description: 'Speed threshold while unbuckled.',
  },
  'Config.Stress.whitelistedJobs': {
    type: 'Array<string>',
    default: '[&#x22;police&#x22;]',
    description: 'Jobs that do not gain stress from server-side GainStress calls.',
  },
}"
/>

<Tabs items="['Speeding', 'Weapons', 'Effects', 'Jobs']">
  <Tab value="Speeding">
    ```lua title="resources/[orbit]/orbit-dynamichud-stress/config.lua"
    Config.Stress.stressSpeedFormat = 'kmh'
    Config.Stress.minForSpeeding = 1000
    Config.Stress.minForSpeedingUnbuckled = 50
    ```

    `stressSpeedFormat` decides whether the thresholds are read as KMH or MPH. `minForSpeeding` is used while the player is buckled, and `minForSpeedingUnbuckled` is used while unbuckled. The default buckled value is very high, which effectively makes normal buckled speeding much less likely to add stress.
  </Tab>

  <Tab value="Weapons">
    ```lua title="resources/[orbit]/orbit-dynamichud-stress/config.lua"
    Config.Stress.chance = 0.1
    Config.Stress.whitelistedWeapons = {
        `weapon_petrolcan`,
        `weapon_hazardcan`,
        `weapon_fireextinguisher`,
    }
    ```

    `chance` is a decimal chance from `0` to `1`. For example, `0.1` means a 10 percent chance per eligible shot. Weapons in `whitelistedWeapons` never add weapon stress.
  </Tab>

  <Tab value="Effects">
    ```lua title="resources/[orbit]/orbit-dynamichud-stress/config.lua"
    Config.Stress.minForShaking = 50
    Config.Stress.blurIntensity = {
        [1] = { min = 50, max = 60, intensity = 1500 },
        [2] = { min = 60, max = 70, intensity = 2000 },
        [3] = { min = 70, max = 80, intensity = 2500 },
        [4] = { min = 80, max = 90, intensity = 2700 },
        [5] = { min = 90, max = 100, intensity = 3000 },
    }
    ```

    `minForShaking` is the first stress value where effects can run. Each `blurIntensity` range controls how strong blur can be for that stress band. Each matching `effectInterval` range controls how often the effect can repeat.
  </Tab>

  <Tab value="Jobs">
    ```lua title="resources/[orbit]/orbit-dynamichud-stress/config.lua"
    Config.Stress.whitelistedJobs = {
        'police'
    }
    ```

    Whitelisted jobs skip server-side stress gain from `hud:server:GainStress`. They can still have their state changed directly by custom code that writes to `Player(source).state.stress`.
  </Tab>
</Tabs>

## Framework Notes [#framework-notes]

<Tabs groupId="framework" items="['ESX', 'QB', 'QBX', 'Standalone']">
  <Tab value="ESX">
    Whitelisted jobs should match the ESX job names returned by `orbit-lib`.
  </Tab>

  <Tab value="QB">
    Whitelisted jobs should match `PlayerData.job.name`.
  </Tab>

  <Tab value="QBX">
    The stress logic is adapted from the QBX HUD stress system and keeps the same state-bag style integration.
  </Tab>

  <Tab value="Standalone">
    Whitelisted jobs are based on the job data returned by `Config.Standalone.fetchJob` in `orbit-lib`, or the `Config.Standalone.defaultJob` fallback.
  </Tab>
</Tabs>
