Skip to main content
Everything public lives under the UgCore global. Each namespace has a page in this reference.

Core

Enums, Events, Lifecycle, Config, Logger, Version, Modules.

Networking and security

Schema, RateLimit, Callback, Network, Guard, Hooks.

Modules

Identity, Players, LocalPlayer, Permissions, Characters, Accounts, Jobs, Gangs, Sessions, Commands, Locale.

Where a function runs

Each function is marked with where it exists: Server only on the server. Client only on clients. Shared on both, with the same signature. Some namespaces exist on both sides with different functions, such as Accounts: the client side reads the local player’s data.

Return values

Functions that change state return ok first, then a value, then an error code:
Each slot always has one type: ok is a boolean, the value is nil on failure, the error code is nil on success. Error codes are listed in Error codes.

Errors

Wrong API usage raises an error that points to your line and starts with [ug-core]:
Problems that depend on players or data never raise: they return an error code.

Threads

Functions that touch the database or wait for a client are marked MUST run in a thread. Callback handlers, net event handlers and event handlers already run in one. Elsewhere, wrap the call in CreateThread.

Copies

Tables returned by UgCore are copies. Changing them changes nothing in UgCore. Calls through exports copy both ways.

Typing

Every function is annotated for the Lua language server. Your editor shows parameters, return types and enum values, and flags typos such as UgCore.Players.Gt as errors.