Tes3Mod:AddItem
The UESPWiki – Your source for The Elder Scrolls since 1995
AddItem
AddItem, ObjectID, Count
Where ObjectID = Object to add to caller's inventory.
Count = Number of item to add
Type: Object
Returns: none
Example: player->AddItem, "Gold_001", 200 (gives player 200 gold)
"sinnammu mirpal"->AddItem, cloudcleaver_unique, 1
Scripts: bladeScript
blueScript
Adds the given number of the item to the calling NPC. Note that the Count value has a short type which limits the number of items that you can add to 65535 (or possibly 65534).
This function does accept global variables but only in dialogue results, not scripts. It doesn't work when you set the global variable in the same dialogue result. Either set the variable before starting dialogue, or in a dialogue line that precedes the response with the AddItem result (e.g Greeting).
When an NPC has armor added to its inventory (via AddItem or normally when you sell it to them), it will automatically equip the armor if:
- The NPC's skill in using that armor is higher than that of its currently equipped armor (NPCs with higher Unarmored skill than the rest of the armored skills will never wear armor).
- The armor value of the new piece of armor is higher than the previous. (It will not switch to an equivalent armor piece).
Also, an NPC will not replace a lost/removed/broken armor piece unless a new one is added.
There is a related bug/feature when using AddItem/RemoveItem with a container. The game remembers when you change the contents of this container, and if you haven't, there is no need to store the container's contents after you took all that was within. The first AddItem will always work on a container, but after that you need first to move anything into the container (i.e., actually have the player add an item within the game), before another AddItem shows any effect.
See Also: RemoveItem

![[Content is available under Attribution-ShareAlike]](http://www.uesp.net/w/images/Somerights.png)