eventOnUnequipped(ActorakActor)
Description
Wiki Description
Event called when the object reference has been unequipped by an actor.
Documentation Comment
Event received when this object is unequipped by an actor
Caveats
CK Wiki - Notes
When an object is unequipped it may still be inside a container, which means that you cannot call most native functions on it.
Parameters
Examples
Event OnUnequipped(Actor akActor)
if akActor == Game.GetPlayer()
Debug.Trace("We were unequipped from the player!")
endIf
endEventSpell Property OurSpecialAbility Auto
{A Constant Effect, Ability Spell. Is Special.}
Event OnEquipped(Actor Who)
{when this item is equipped apply our special ability
spell instead of an enchantment.}
Who.AddSpell(OurSpecialAbility)
Return
EndEvent
Event OnUnequipped(Actor Who)
{when this item is removed check if it was beacuse they
entered a power armor frame. if so, reapply the effect.}
If(Who.IsInPowerArmor())
;; reapply. this can probs technically be skipped.
;; but lets be double sure it did not fall off.
Who.AddSpell(OurSpecialAbility)
Else
;; remove.
Who.RemoveSpell(OurSpecialAbility)
EndIf
Return
EndEventAuto-Generated Example
Scriptname MyCoolScript extends ObjectReference
event OnUnequipped(Actor akActor)
Debug.trace("Event received - OnUnequipped: akActor = " + akActor)
endEventRelated Pages
- ObjectReference
- ObjectReference.OnEquipped(...)
- Actor.OnItemEquipped(...)
- Actor.OnItemUnequipped(...)
