Background for Starfield
Member of the ScriptObject script
voidfunctionUnregisterForAllHitEvents(ScriptObjectakTarget=NONE)Native

Description

Wiki Description

Unregisters this script from all OnHit events from the specified target - or from all targets if given a None target.

Only the script that unregisters for an event will stop receiving it. Other scripts attached to the same form, alias, or magic effect will still receive the event if they registered for it separately.

Documentation Comment

Remove all hit event registrations - if target is None - ALL event registrations for this script are removed


Caveats

CK Wiki - Notes

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

Parameters

  1. ScriptObjectakTarget=NONE

    CK Wiki Description

    The ObjectReference, ReferenceAlias or RefCollectionAlias that we no longer want to get hits from. If None, we will unregister for ALL hit events.

    • Default:None

Examples

; We no longer care about any hits the player receives
UnregisterForAllHitEvents(Game.GetPlayer())
; We no longer care about any hit events
UnregisterForAllHitEvents()

Auto-Generated Example

ScriptObject myScriptObject__akTarget

myScriptObject__toCallFunctionOn.UnregisterForAllHitEvents(myScriptObject__akTarget)

Related Pages


Additional References

View this function’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.