BroadcastMessage
7/14/25Less than 1 minute
MLStation.BroadcastMessage(string methodName, any parameter = nil)
Calls the method named methodName on every Lua Script in this game object or any of its children.
Parameters:
| Name | Type | Description | 
|---|---|---|
| methodName | string | Name of the method to call. | 
| parameter | any | Optional parameter to pass to the method (can be any value). | 
Usage
---@type MLStation
local mlstation;
---@type string
local methodName;
---@type any
local parameter;
mlstation.BroadcastMessage(methodName, parameter)Example
The Method needs to be attached to the Script object, similar to Start or Update functions.
do
	local script = LUA.script;
	function script.DoSomething()
	end
endCall DoSomething function:
do
	local script = LUA.script;
	local component = SerializedField("Component", TYPE.OBJECT);
	function script.Start()
		component.BroadcastMessage("DoSomething");
	end
end
