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.
Syntax
Section titled “Syntax”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 |
Example
Section titled “Example”function OnRegionEvent(fromRegion, name, data) if name == "siege" then SendClientMessageToRegion(0xFFD070FF, "War has come to " .. fromRegion .. ".") endendSee also
Section titled “See also”TriggerRegionEvent · OnClusterValueChange · the Regions group of the index
