Dispatches a custom event to listeners.
| Name | Type | Description |
|---|---|---|
name | string | The name of the custom event. |
dataTable | table | Table containing event data to pass to listeners. |
Two values: the final cancelled boolean and the event table.
local cancelled, e = emit("myCustomEvent", { foo = "bar" })
if not cancelled then
log("Event ran successfully.")
end
cancel field is ignored, and source is set to the emitting plugin's name. Cancellation is a shared flag, not an instruction to stop dispatching later listeners.