This page gives you a practical overview of what TS-Lib exposes at runtime once you includeDocumentation Index
Fetch the complete documentation index at: https://docs.toine.me/llms.txt
Use this file to discover all available pages before exploring further.
@ts-lib/import.lua in your resource.
Core utilities
TS-Lib attaches a few helpers to a globalTS table that are reused across Toine Scripts.
Logging
Utils.Print(message, resourceName?)Utils.DebugPrint(message, resourceName?)Utils.ErrorPrint(message, resourceName?)Utils.SuccessPrint(message, resourceName?)
Generic utils
Common helpers include:Utils.IsRessourceLoaded(resourceName): booleanUtils.IsTableEmpty(tbl): boolean
Intervals
TS-Lib embeds an interval helper to simplify repeating callbacks:TS.Intervals.Set(callback, ms, ...): idTS.Intervals.Clear(id)
UI helpers
TS-Lib exposes small, framework-agnostic UI helpers throughTS.Lib.*.These are rendered via the bundled NUI (
ui/build).
Subtitle
TS.Lib.Subtitle.Show(text: string)TS.Lib.Subtitle.Hide()
@ts-lib/import.lua:
Text UI (help text)
TS.Lib.TextUI.Show(text: string, position?: string)TS.Lib.TextUI.Hide()
position defaults to 'top-left'. Common positions used by the UI are:
top-lefttop-center
Text Input
TS.Lib.TextInput(data: table): table
Command System
TS-Lib provides a unified command registration system with built-in type validation and permission support.TS.Lib.Command.add(commandName, properties, callback)
Parameter Types
| Type | Description |
|---|---|
number | Converts argument to a number |
playerId | Accepts ‘me’ or player ID; validates player exists |
string | Ensures argument is not a number |
longString | Captures all remaining text (must be last parameter) |
boolean | Accepts true/false, yes/no, 1/0, on/off |
Server Utilities
Update Checker
TS.CheckUpdate(versionUrl, changelogUrl?)
Bridge Helpers
TS.Bridge.GetPlayers(): table- Returns a list of player sourcesTS.Bridge.HasPermission(source, permission): boolean- Checks if player has a permission (uses framework bridge or ACE as fallback)
Bridges overview
The main reason to use TS-Lib is its bridge modules. They expose normalized APIs that hide framework-specific or script-specific details.Bridge.Framework.*→ talks to your framework (QBCore / ESX / QBox / standalone)Bridge.Garages.*→ talks to your garage scriptBridge.VehicleKeys.*→ talks to your vehicle keys scriptBridge.Notify.*→ unified notification system
Framework bridge (quick reference)
Client
-
Bridge.Framework.Client.PlayerData
Unified player data, automatically updated when the player loads / unloads / changes job. -
Bridge.Framework.Client.Functions.GetPlayerJob() -> ok, jobOrError
Bridge.Framework.Client.Functions.Notify(message, type?)
Server
Bridge.Framework.Server.Functions.GetPlayerJob(source)Bridge.Framework.Server.Functions.GetPlayersByJobName(jobName, checkOnDuty?)Bridge.Framework.Server.Functions.GetPlayers()Bridge.Framework.Server.Functions.GetVehicleType(model)Bridge.Framework.Server.Functions.HasPermission(source, permission)
Garage bridge (quick reference)
Server
Bridge.Garages.Server.Functions.IsVehicleOwned(plate, netId?) -> booleanBridge.Garages.Server.Functions.SetVehicleOutsideState(plate, state)
Vehicle keys bridge (quick reference)
The keys bridge focuses on locking / unlocking vehicles from a unified entrypoint.Client
Bridge.VehicleKeys.Client.Functions.SetDoorStatus(entity, lockStatus)
1 = unlocked, 2 = locked, 4 = locked for all players, etc.).
See Vehicle Keys Bridges for system-specific behavior (qb-vehiclekeys, qs-vehiclekeys, standalone).
Notify bridge (quick reference)
The notify bridge provides a unified way to send notifications across different frameworks.Client
Bridge.Notify.Client.Functions.Notify(message, type?)
- QBCore:
success,error,warning,info(or any custom type) - ESX: Uses ESX notification system