Orbit StudiosOrbit Studios
Orbit Studios Resourcesorbit-dynamichud-v2

Exports

Complete client and server export reference for orbit-dynamichud-v2.

Exports

Exports are called from another resource. Client exports affect only the local player; the server toggleHud export accepts a target player source.

Client exports

ExportSignatureReturnPurpose
notifynotify(data)noneShow a notification.
NotifyNotify(data)noneCase-compatible alias of notify.
showTextUIshowTextUI(text, options?)noneShow or replace the local Text UI prompt.
hideTextUIhideTextUI()noneHide Text UI.
isTextUIOpenisTextUIOpen()boolean, string?Return open state and current text.
skillCheckskillCheck(difficulty, inputs?)booleanRun a blocking skill check.
skillCheckActiveskillCheckActive()booleanTest whether a skill check is active.
cancelSkillCheckcancelSkillCheck()noneCancel the active skill check.
progressBarprogressBar(data)booleanRun a blocking progress action.
progressActiveprogressActive()booleanTest whether a progress bar is active.
cancelProgresscancelProgress()noneForce-cancel the active progress bar.
SeatbeltStateSeatbeltState(state)noneSet the local speedometer seatbelt indicator.
CruiseControlStateCruiseControlState(state)noneSet the local speedometer cruise indicator.
toggleHudtoggleHud(visible)noneAsk the server to replicate HUD visibility for the local player.
getHudVisibilitygetHudVisibility()booleanReturn whether the gameplay HUD is currently visible after temporary visibility gates are applied.
getOnboardingStategetOnboardingState()booleanReturn the current local onboarding state.
startOnboardingstartOnboarding()booleanRequest incomplete onboarding to start. Returns whether the request passed the client-side configuration and login guards.
closeOnboardingcloseOnboarding()booleanClose onboarding and return whether an active or pending onboarding state existed.

Detailed option tables and examples for the first eleven exports are in Interface APIs.

resources/[custom]/client/main.lua
exports['orbit-dynamichud-v2']:notify({
    description = 'Saved successfully.',
    type = 'success'
})

exports['orbit-dynamichud-v2']:showTextUI('[E] Interact')

local passed = exports['orbit-dynamichud-v2']:skillCheck('easy', { 'E' })
local completed = exports['orbit-dynamichud-v2']:progressBar({
    label = 'Working',
    duration = 3000
})

exports['orbit-dynamichud-v2']:hideTextUI()

Vehicle state exports

Use the state bags described on the Events and State Bags page when your resource already owns replicated vehicle/player state. The exports are useful for older client-only integrations.

resources/[custom]/client/seatbelt.lua
exports['orbit-dynamichud-v2']:SeatbeltState(true)
exports['orbit-dynamichud-v2']:CruiseControlState(false)

SeatbeltState expects a truthy or false value. CruiseControlState forwards the supplied value to the UI. Call them only when state changes rather than every frame.

HUD visibility

The client export emits a source-bound server event that updates the calling player's replicated hud:showHud state:

resources/[custom]/client/main.lua
exports['orbit-dynamichud-v2']:toggleHud(false)

-- Show it again later.
exports['orbit-dynamichud-v2']:toggleHud(true)

Read the effective local visibility state when another resource needs to coordinate its own interface:

resources/[custom]/client/main.lua
local hudVisible = exports['orbit-dynamichud-v2']:getHudVisibility()

if hudVisible then
    -- The gameplay HUD is currently being rendered.
end

This getter includes temporary visibility gates such as onboarding and game-menu state. It does not change the replicated hud:showHud value.

The server export accepts a player source first:

resources/[custom]/server/main.lua
exports['orbit-dynamichud-v2']:toggleHud(source, false)

Server exports

ExportSignatureReturnPurpose
toggleHudtoggleHud(source, visible)noneSet Player(source).state['hud:showHud'] with replication enabled.

Validate the target source in network-facing code before calling the server export. Do not accept an arbitrary target from an untrusted client event without permission checks.

Onboarding state and controls

Use the client exports when another local resource needs direct onboarding control:

resources/[custom]/client/main.lua
local onboardingState = exports['orbit-dynamichud-v2']:getOnboardingState()

if onboardingState then
    local requested = exports['orbit-dynamichud-v2']:startOnboarding()
    print(('Onboarding request accepted: %s'):format(requested))
end

-- Close the flow when an external setup or character flow takes over.
exports['orbit-dynamichud-v2']:closeOnboarding()

startOnboarding is non-forcing: it follows Config.Onboarding, Config.SettingsLocked, player-login, and completed-state guards. It does not reopen onboarding for a player who already completed it. closeOnboarding synchronizes the NUI state and releases onboarding focus without closing an unrelated HUD interface.

See Onboarding for automatic/manual modes and Events and State Bags for event-based integrations.

Resource-stop cleanup

Resources that show Text UI should hide it from their client onResourceStop handler. Cancel a skill check or progress bar only if your resource started it and still owns the active flow.

resources/[custom]/client/main.lua
AddEventHandler('onResourceStop', function(resourceName)
    if resourceName ~= GetCurrentResourceName() then return end

    exports['orbit-dynamichud-v2']:hideTextUI()

    if exports['orbit-dynamichud-v2']:skillCheckActive() then
        exports['orbit-dynamichud-v2']:cancelSkillCheck()
    end

    if exports['orbit-dynamichud-v2']:progressActive() then
        exports['orbit-dynamichud-v2']:cancelProgress()
    end
end)

On this page