ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher

Documentation

Lua scripting in Trilogy Hub

You write Trilogy Hub servers in Lua, the same way as in MTA:SA: resources with meta.xml, events, exports and the same function names. Here you will find every function and event described with examples.

SserverCclientBboth sides

New functions and events! 15

Start here

Catalogue and effects

Functions and events

Categories

What it looks like

A whole resource is a folder with meta.xml and scripts. This one greets the player in chat and puts them near Grove Street.

addEventHandler("onPlayerJoin", root, function()
    spawnPlayer(source, 2495.3, -1687.0, 13.5)
    outputChatBox("Welcome to Grove Street, " .. getPlayerName(source) .. "!", source, 255, 122, 34)
end)

Do it step by step