Skip to content

OnRegionEvent

The mode’s copy on a level of this server sent this level an event.

Each region runs its own copy of the mode, so they cannot share Lua variables: TriggerRegionEvent is how they talk. It comes at this level’s next tick, on its own thread.

function OnRegionEvent(fromRegion, name, data)
-- ...
end
Parameter Type
fromRegion string the level that sent it
name string the event’s name
data string what came with it, "" for none
function OnRegionEvent(fromRegion, name, data)
if name == "siege" then
SendClientMessageToRegion(0xFFD070FF, "War has come to " .. fromRegion .. ".")
end
end

TriggerRegionEvent · OnClusterValueChange · the Regions group of the index