Background for Fallout 4
Member of the ObjectReference script
voidfunctionAddItem(FormakItemToAdd, intaiCount=1, boolabSilent=false)Native

[DEV SERVER] Loading description...


Caveats


Parameters

FormakItemToAdd

CK Wiki Description

The form to add to this reference's inventory. If this is a base object, it will add a newly-created item. If it is a reference, it will move/remove it from its place/container to this container. If it is a form list, then it will add aiCount of each item in the list.

  • Note:This can accept non-persistent references in containers.

intaiCount=1

CK Wiki Description

How many references to add. Note that this must be 1 if you are passing in an object reference.

boolabSilent=false

CK Wiki Description

If true, no message will be printed to the screen


Examples

; Add two diamonds to the player's inventory, silently
Game.GetPlayer().AddItem(Diamond, 2, true)
; Move the special gem reference from wherever it is into the chest
Chest.AddItem(SpecialGemRef)

Auto-Generated Example

Form myForm__akItemToAdd
int myInt__aiCount
bool myBool__abSilent

myObjectReference__toCallFunctionOn.AddItem(myForm__akItemToAdd, myInt__aiCount, myBool__abSilent)

Related Pages


Additional References

View this function’s page on the Fallout 4 Creation Kit Wiki

Some data provided by the Fallout 4 Creation Kit Wiki. Licensed under the Creative Commons Attribution-Share Alike 4.0 license.