Difference between revisions of "AddItem"
You can use reference-variables for ObjectID !
imported>Deathbane27 |
imported>JOG (You can use reference-variables for ObjectID !) |
||
Line 1: | Line 1: | ||
=='''Description'''== | =='''Description'''== | ||
Adds Count items of object ''ObjectID'' to the calling container's inventory. | Adds ''Count'' items of object ''ObjectID'' to the calling container's inventory. | ||
<br> | |||
=='''Syntax'''== | =='''Syntax'''== | ||
AddItem ''ObjectID'', ''Count'' | AddItem ''ObjectID'', ''Count'' | ||
==''' | <br> | ||
AddItem MyObject, 1 | =='''Examples'''== | ||
AddItem MyObject, 1 | |||
Ref MyItem | |||
Short count | |||
set MyItem to ArenaAkaviriLongSword | |||
set count to 1 | |||
player.additem MyItem Count | |||
==''' | <br> | ||
=='''Notes'''== | |||
* You can use a [[Variable_types:_reference_variables|reference variable]] as ''ObjectID'' and a [[Variable_types:_shortint|short]] variable for ''count''. | |||
* 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. | |||
---- | ---- | ||
Line 36: | Line 45: | ||
<br/><br/> | <br/><br/> | ||
==Reference== | ==Reference== |