Skip to main content

LuaEvents.InvokeLocalForAll(LuaBehaviour script, string eventName, [optionalArguments] optional-arguments)

Like InvokeForAll() but invokes the local event that defined in the exact similar game object and Lua Script in all the clients. This requires for that game object to be existed during the build or instantiated using network methods.

Parameters:

NameTypeDescription
scriptLuaBehaviourThe current running script object from LUA.script.
eventNamestringThe name of the local event.
optional-arguments[optionalArguments]

Usage

---@type LuaBehaviour
local script;

---@type string
local eventName;

---@type [optionalArguments]
local optional-arguments;


LuaEvents:InvokeLocalForAll(script, eventName, optional-arguments)