-
Notifications
You must be signed in to change notification settings - Fork 4
Server Object
Konijima edited this page Jul 11, 2022
·
1 revision
To access the server object you must require it in your file.
local Server = require 'MyModName/Server';
Server.Config -- Contains your shared config
Server.Utils -- Contains your shared utility functions
Server.Data -- Contains your server GlobalModData tables
Server.Modules -- Contains your server modules
Server.Commands -- Contains your client command handlers
Server.Log(str) -- Log a message with your mod name as prefix
Server.SendCommand(command, data, player) -- Send a command with data to client(s)
Server.AddEvent(eventName, callback) -- Add a callback to a custom event
Server.RemoveEvent(eventName, callback) -- Remove a callback from a custom event
Server.TriggerEvent(eventName, ...) -- Trigger a custom event with up to 8 parameters
Server.TransmitModData(modDataName) -- Transmit a GlobalModData table to all clients