GetItemCount

From the Fallout3 GECK Wiki
Jump to navigation Jump to search

Description[edit | edit source]

Returns the amount of ObjectID in the container\actor\creature.

Syntax[edit | edit source]

[ContainerID.]GetItemCount ObjectID

Examples[edit | edit source]

Player.GetItemCount Caps001
If Player.GetItemCount Caps001 == 0
  Player.AddItem Caps001 100
EndIf

Notes[edit | edit source]

  • You can use a reference variable as ObjectID.
  • You can use a FormList as the item parameter -- in this case, the function returns the sum of the counts for all items in the list.
  • IMPORTANT: FALLOUT3 (not tested for New Vegas) -- if player.GetItemCount FormListID >=1. Will ALWAYS return true so long as one of the items is in the players inventory. So it is NOT advised to use this for item checking but rather be more efficiently used for player.RemoveItem.
  • Does not work with Notes. Use GetHasNote to check if the Player has a specific note.

See Also[edit | edit source]