Difference between revisions of "AddItem"

3 bytes added ,  09:03, 8 June 2007
onAdd block correction
imported>DragoonWraith
m (apparently you can't capitalize it...)
imported>Scruggs
(onAdd block correction)
Line 20: Line 20:
* You can use a [[Variable_types:_reference_variables|reference variable]] as ''ObjectID'' and a [[Variable_types:_shortint|short]] variable for ''count''.  
* 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.
* This function will trigger an [[onAdd]] block in a script attached to the target container, as long as the container is in a loaded cell. When used on a container in a remote cell, the [[onAdd]] block won't run until the player enters that container's cell.


*By default, using this function on the player will display a message informing the player that the item in question has been added. In many situations, this is very annoying, but you can use a blank [[Message]] call to prevent it from happening, like so:
*By default, using this function on the player will display a message informing the player that the item in question has been added. In many situations, this is very annoying, but you can use a blank [[Message]] call to prevent it from happening, like so:
Anonymous user