Mod:Creation Kit/SendCustomEvent - ScriptObject

Member of: Mod:Creation Kit/ScriptObject Script

Sends the specified custom event to any scripts that have registered for it. The event must be defined in our script or in one of our parent scripts. This function returns immediately, not waiting for any of the receivers.

Syntax
Function SendCustomEvent(CustomEventName asEventName, Var[] akArgs = None) native

Parameters

 * asEventName: The event to send. This must be a raw string literal and may not be a variable.
 * akArgs: The array of arguments to send to the receivers.
 * Default: None

Return Value
None

Examples
CustomEvent Ambush
 * Define the custom event "Ambush" in this script

Event OnActivate(ObjectReference akSource) ; Send the Ambush event to anyone listening with no arguments SendCustomEvent("Ambush") ; Send the Ambush event with two arguments Var[] kargs = new Var[2] kargs[0] = akSource kargs[1] = 4.2 SendCustomEvent("Ambush", kargs) endEvent