Core libraryFor developers

For developers

Use tr_core in your own resources.

On this page

tr_core is open source (GPL-3.0), and you can use it in your own resources too.

Loading it

Add one line to your resource's fxmanifest.lua:

fxmanifest.lua
shared_script '@tr_core/init.lua'

dependencies {
    'tr_core',
}

Then everything is on TR: TR.player, TR.inventory, TR.callback, TR.ui and the rest. Each part loads the first time you use it, and works the same on ESX, QBCore and Qbox.

server/main.lua
-- The same on every framework and inventory.
if TR.inventory.hasItem(source, 'lishi_pick') then
    TR.inventory.removeItem(source, 'lishi_pick', 1)
end

Needing a certain version

If your resource uses something added in a later tr_core, say so in its fxmanifest.lua:

fxmanifest.lua
tr_core_version '1.3.0'

Servers with an older tr_core then get a clear message in the console when your resource starts.

Starting a new resource

tr_core comes with a starting point in templates/resource: a manifest, a config, locales and client and server files, already set up. Copy it, rename it, and start building.

Still stuck? Open a ticket on Discord.