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.
Client-side integration
These state values, events, and the compatibility export belong to the client. Server resources should not assume local-only seatbelt or cruise state is automatically replicated.
Prop
Type
Read current state
local seatbeltOn = LocalPlayer.state.seatbelt == true
local cruiseOn = LocalPlayer.state.cruise == true
local harnessOn = LocalPlayer.state.harness == trueState 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
AddEventHandler('seatbelt:client:ToggleSeatbelt', function()
local seatbeltOn = LocalPlayer.state.seatbelt == true
end)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.
local hasHarness = exports['orbit-dynamichud-addons']:HasHarness()LocalPlayer.state.harness = trueIntegration checklist
- Compare state values with
== truebecause they can benilbefore initialization. - Listen for toggle events only when an immediate reaction is needed; otherwise read current state at the point of use.
- Let one resource own writes to seatbelt and cruise state.
- Prefer
LocalPlayer.state.harnessover the deprecated compatibility export for new integrations. - Clear or update external harness state when the harness is removed so ejection logic does not remain protected incorrectly.