Installation

How to install tLib on your FiveM or Helix server.

Setup

Prerequisites

  • FiveM or Helix server

Download

Download the latest release from GitHub Releases.

Extract

Place the tLib folder in your server's resources directory.

Start the Resource

Add to your server.cfg before any resource that depends on it:

server.cfg
ensure tLib

Usage in Your Resource

To use tLib as a dependency, add it to your resource's fxmanifest.lua:

fxmanifest.lua
dependencies { 'tLib' }

Using Exports

Call tLib systems directly via exports:

-- Create and open a menu
local menuId = exports['tLib']:CreateMenu('my_menu', 'My Menu', 'Subtitle')
exports['tLib']:AddButton(menuId, 'btn1', 'Click Me', 'A button', function()
    print('clicked!')
end)
exports['tLib']:RefreshMenu(menuId)
exports['tLib']:OpenMenu(menuId)

Using Import Modules

For lightweight modules (coords, kvp, settings, movemode, layouts), declare them in your fxmanifest.lua and add the imports script:

fxmanifest.lua
dependencies { 'tLib' }
shared_scripts { '@tLib/imports.lua' }
tlib_modules { 'kvp', 'settings' }

Then access them via the tlib global:

local kvp = tlib.kvp
local value = kvp.getString('my_key', 'default')

Modules are lazy-loaded — they only load when first accessed.

On this page

Need help?

Ask on Discord