Skip to Content
Cobalt

cobalt_hud

Status circles and the speedometer.

SetHiddenBy

Client

Hides the HUD while any key set by any resource is hidden, and shows it again once all are cleared. Keys are scoped to the calling resource and cleared when that resource stops.

exports.cobalt_hud:SetHiddenBy(key, hidden)
ParameterTypeOptionalDescription
keystringNo
hiddenbooleanNo
Example
exports.cobalt_hud:SetHiddenBy('cinematic', true)

SetStress

Server

Sets a player's stress, clamped.

exports.cobalt_hud:SetStress(source, value)
ParameterTypeOptionalDescription
sourceintegerNoserver id
valuenumberNo
Example
exports.cobalt_hud:SetStress(source, 1.0)

AddStress

Server

Adds stress to a player, or relieves it when amount is negative; exempt jobs gain none.

exports.cobalt_hud:AddStress(source, amount)
ParameterTypeOptionalDescription
sourceintegerNoserver id
amountnumberNo
Example
exports.cobalt_hud:AddStress(source, 100)

AddAlcohol

Server

Adds alcohol to a player, capped at 100; at 100 the player blacks out and wakes up somewhere else.

exports.cobalt_hud:AddAlcohol(source, amount)
ParameterTypeOptionalDescription
sourceintegerNoserver id
amountnumberNo
Example
exports.cobalt_hud:AddAlcohol(source, 100)

On this page