Utility

The Utility library provides common client-side helper functions.

Side: Client

Functions

LoadModel

Loads a model and waits until it’s available.

Bridge.Utility.LoadModel(model)
ParameterTypeDescription
modelstring | numberModel name or hash

LoadAnimDict

Loads an animation dictionary and waits until it’s available.

Bridge.Utility.LoadAnimDict(dict)
ParameterTypeDescription
dictstringAnimation dictionary name

LoadPtfxAsset

Loads a particle effect asset.

Bridge.Utility.LoadPtfxAsset(asset)
ParameterTypeDescription
assetstringPTFX asset name

GetCommandKey

Returns the key binding string for a registered command/key mapping.

local key = Bridge.Utility.GetCommandKey(command)
-- Returns: string (e.g. 'E', 'MOUSE_LEFT')
ParameterTypeDescription
commandstringCommand name (e.g. ‘+place_object’)

DrawText3D

Draws 3D text at a world position (call each frame).

Bridge.Utility.DrawText3D(coords, text, scale, font)
ParameterTypeDescription
coordsvector3World position
textstringText to display
scalenumberText scale (optional)
fontnumberFont ID (optional)