Skip to main content

Event

Description:

  Creates a definition for an action that emits event.

Signature:

Event: function(
name: string,
param?: string --[[""]]
): ActionDef

Usage:

-- Get this event by register event from the action performing node.
node:slot("EventName", function(param: string)
print("EventName triggered with param", param)
end)
node:perform(Sequence(
Delay(3),
Event("EventName", "Hello")
))

Parameters:

ParameterTypeDescription
namestringThe name of the event to be triggered.
paramstringThe parameter to pass to the event. (default: "")

Returns:

Return TypeDescription
ActionDefThe created ActionDef.