UnregisterForCustomEvent - ScriptObject

Revision as of 22:25, 19 January 2025 by BellCube (talk | contribs) (Correct Parameter Name (akEventSource --> akSender; retains confusion levels perfectly!))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Member of: ScriptObject Script

Unregisters this script from receive the specified custom event from the source object whenever that source object sends the event. This will only unregister this script and not any other script attached to the same form, or alias or magic effect.

SyntaxEdit

Function UnregisterForCustomEvent(ScriptObject akSender, CustomEventName asEventName) native

ParametersEdit

  • akSender: The ScriptObject that receives the event we no longer want to receive.
  • asEventName: The custom event we do not want relayed to us. This must be a raw string literal and may not be a variable.

Return ValueEdit

None

ExamplesEdit

; Stop receiving Ambush events from the ambush trigger
UnregisterForCustomEvent(kAmbushTrigger, "Ambush")

NotesEdit

Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.

See AlsoEdit