Difference between revisions of "IsEquipped - Actor"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Terra Nova2
m (→‎Notes: function doesn't check the left hand when dual wielding,)
imported>Chesko
(This function also works with FormLists.)
Line 11: Line 11:


== Parameters ==
== Parameters ==
*akItem: The item to check for.
*akItem: The item to check for. If a FormList, checks if any form in the list is equipped.


== Return Value ==
== Return Value ==

Revision as of 23:38, 13 March 2016

Member of: Actor Script

Does the actor have the specified item equipped?

Syntax

bool Function IsEquipped(Form akItem) native

Parameters

  • akItem: The item to check for. If a FormList, checks if any form in the list is equipped.

Return Value

If the actor has the item equipped or not.

Examples

; Does the player have the uber sword equipped?
if (Game.GetPlayer().IsEquipped(UberSwordProperty))
  Debug.Trace("The player has the uber sword equipped")
endIf

Notes

  • Specifying a light that can be carried (e.g., torches) as akItem will always return false no matter if the light is equipped or not. To determine if the actor has a light equipped, use GetEquippedItemType(). Light forms will send OnObjectEquipped() events, however.
  • This function doesn't check the left hand when a character is dual wielding. See Talk:IsEquipped - Actor‎ for an alternative.

See Also