Difference between revisions of "AddItem"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
 
imported>Deathbane27
Line 8: Line 8:
Adds Count items of object ObjectID to the calling container's inventory.  
Adds Count items of object ObjectID to the calling container's inventory.  


NOTE: This will not trigger [[OnAdd]] blocks, because the item is created inside the inventory rather than actually being added. For creating items from the console that you need to trigger OnAdd, use [[PlaceAtMe]] instead and pick the item up from the ground.  
NOTE: This will not trigger [[OnAdd]] blocks, because the item is created inside the inventory rather than actually being added. For creating items from the console that you need to trigger OnAdd, use [[PlaceAtMe]] instead and pick the item up from the ground.
 
----
 
Console Usage:  When using AddItem with the console, you must use the desired item's FormID, not the EditorID.
 
So, instead of using
player.additem lockpick 1
to give yourself a lockpick, you must use
player.additem 00000A 1


[[Category: Functions]]
[[Category: Functions]]
[[Category: Object Functions]]
[[Category: Object Functions]]

Revision as of 05:35, 26 March 2006

Syntax:

AddItem ObjectID, Count 

Example:

AddItem MyObject, 1 

Adds Count items of object ObjectID to the calling container's inventory.

NOTE: This will not trigger OnAdd blocks, because the item is created inside the inventory rather than actually being added. For creating items from the console that you need to trigger OnAdd, use PlaceAtMe instead and pick the item up from the ground.


Console Usage: When using AddItem with the console, you must use the desired item's FormID, not the EditorID.

So, instead of using

player.additem lockpick 1

to give yourself a lockpick, you must use

player.additem 00000A 1