UnequipItem - Actor
Member of: Actor Script
Forces this actor to unequip the specified item, preventing equipping if requested. Updated to remove the item from the left hand weapon slot too.
SyntaxEdit
Function UnequipItem(Form akItem, bool abPreventEquip = false, bool abSilent = false) native
ParametersEdit
- akItem: The item the actor should unequip.
- abPreventEquip: If true, prevents the actor (or player) from equipping the item.
- Default: False
- abSilent: Should the unequip message be silenced?
- Default: False
Return ValueEdit
None.
ExamplesEdit
; Force the player to unequip the tutu - but they can equip it
Game.GetPlayer().UnequipItem(TutuProperty)
; Force Sally to unequip the dress - and they can't equip it
Sally.UnequipItem(DressProperty, true)
NotesEdit
- It is possible for this function to deplete the enchantment charges on weapons in the player's inventory under certain conditions. Please see the discussion tab.
- abPreventEquip does not seem to work as described when used on NPCs. They seem fully capable of re-equipping items unequipped with this flag set to true. More testing is needed.
- abPreventEquip works for the Ammo objects. Enemy archers are left there holding their bow, unable to do anything. However as noted above, this does not work for Weapon objects.
- Attempting to Equip or Unequip Quest Alias items via script which are generated via the quest fill to method (as opposed to forced fill of an existing reference) will require you to acquire not only the reference but also the base form (ex: Game.GetPlayer().EquipItem(Alias_Waystone.GetReference().GetBaseObject())