Skip to main content

Add the import

fxmanifest.lua
The import defines one global in your resource: UgLib. It is read-only, and UgLib.Internal is private. ug_lib_version is optional. With it, your resource does not start against an older ug-lib:

What runs where

In your resource

Enums, Math, Table, String, Format, Async, Locale and Version on both sides. Cache, Streaming, Entity, Raycast, Screen, Draw, Animation, Zone, Point and Keybind on clients.No export call. Zones and key bindings belong to your resource.

Through ug-lib

Notify, TextUI, Progress, SkillCheck, Dialog, Context, Menu, Radial, Clipboard and Ui, on clients.Waiting happens in your resource. Callbacks and args stay in your resource.
Client-only namespaces raise on the server: UgLib.Dialog exists on clients only.

Waiting calls MUST run in a thread

Dialog.*, Progress.Start, SkillCheck.Start, Radial.Open, inline Context.Open, Streaming.*, Raycast.*, Animation.Play, Animation.AttachProp and Async.WaitFor wait. Call them from a thread, an event handler or a command:
client.lua
Outside a thread they raise: UgLib.Dialog.Confirm MUST run in a thread.

Close reasons

A call that ends without an answer returns its empty value and a reason from UgLib.Enums.CloseReason:

Use enums

Compare and pass values through UgLib.Enums, never as strings:
See Enums.