Skip to content

Client Object

Konijima edited this page Jul 11, 2022 · 1 revision

To access the client object you must require it in your file.

local Client = require 'MyModName/Client';

Properties

Client.Config                           -- Contains your config
Client.Utils                            -- Contains your utility functions
Client.Data                             -- Contains your GlobalModData tables
Client.Modules                          -- Contains your modules
Client.Commands                         -- Contains your server command handlers
Client.TimedActions                     -- Contains your timed actions
Client.UI                               -- Contains your UIs

Methods

Client.Log(str)                         -- Log a message with your mod name as prefix
Client.SendCommand(command, data)       -- Send a command with data to the server 
Client.AddEvent(eventName, callback)    -- Add a callback to a custom event
Client.RemoveEvent(eventName, callback) -- Remove a callback from a custom event
Client.TriggerEvent(eventName, ...)     -- Trigger a custom event with up to 8 parameters

Clone this wiki locally