Exports

orbit-dynamichud- Exports for the resource.

πŸ“¦ Exports

Orbit Dynamic HUD exposes several exports that allow other resources to control HUD behavior and speedometer states.

These exports are available on both server and client.


πŸ–₯️ Server Exports

toggleHud

Toggle the visibility of the HUD for a specific player.

βœ… Syntax

exports["orbit-dynamichud"]:toggleHud(source, bool)

πŸ“₯ Parameters

Name
Type
Description

source

number

Player server ID

bool

boolean

true to show HUD, false to hide

πŸ“Œ Example

local playerId = source

exports["orbit-dynamichud"]:toggleHud(playerId, false)

🧠 Notes

  • Uses player state bags internally (hud:showHud).

  • Replicates to the client automatically.

  • Useful for cutscenes, spectate, onboarding, etc.


πŸ’» Client Exports

These exports allow updating speedometer constants such as seatbelt and cruise control.


SeatbeltState

Updates the seatbelt indicator in the speedometer.

βœ… Syntax

πŸ“₯ Parameters

Name
Type
Description

state

boolean

true if seatbelt is on

πŸ“Œ Example

🧠 Behavior

  • Sends an NUI message with the updated seatbelt state

  • Only updates UI constants β€” no gameplay logic included


CruiseControlState

Updates the cruise control indicator in the speedometer.

βœ… Syntax

πŸ“₯ Parameters

Name
Type
Description

state

boolean

true if cruise control is active

πŸ“Œ Example

🧠 Behavior

  • Sends an NUI message updating cruise control status

  • Purely visual indicator


πŸ”— Integration Example


⚠️ Best Practices

  • Call seatbelt/cruise exports only when state changes (avoid spamming NUI).

  • Use toggleHud instead of custom events when hiding HUD.

  • Keep gameplay logic outside the HUD resource.


Last updated