Orbit StudiosOrbit Studios
Orbit Studios Resourcesorbit-dynamichud-addons

Exports and Events

State bags, client events, and exports available in orbit-dynamichud-addons.

Exports and Events

The addon communicates through local player state bags and local client events. DynamicHUD reads the same state values, so custom resources can use them too.

Prop

Type

Read Current State

resources/[custom]/client/main.lua
local seatbeltOn = LocalPlayer.state.seatbelt == true
local cruiseOn = LocalPlayer.state.cruise == true
local harnessOn = LocalPlayer.state.harness == true

State bag values are local booleans. They can be nil before the player enters a vehicle, so compare with == true when you need a strict boolean.

Listen For Toggles

resources/[custom]/client/seatbelt-listener.lua
AddEventHandler('seatbelt:client:ToggleSeatbelt', function()
    local seatbeltOn = LocalPlayer.state.seatbelt == true
end)
resources/[custom]/client/cruise-listener.lua
AddEventHandler('seatbelt:client:ToggleCruise', function()
    local cruiseOn = LocalPlayer.state.cruise == true
end)

Harness Compatibility

HasHarness() is kept for older integrations, but new code should read the state bag directly.

resources/[custom]/client/harness.lua
local hasHarness = exports['orbit-dynamichud-addons']:HasHarness()
resources/[custom]/client/harness.lua
LocalPlayer.state.harness = true

On this page