Mod:Creation Kit/RemoveItemByComponent - ObjectReference

Member of: Mod:Creation Kit/ObjectReference Script

Removes an arbitrary number of arbitrary items such that at least the specified number of the specified component is removed from this reference's inventory, possibly silently.

Syntax
Function RemoveItemByComponent(Form akComponentToRemove, int aiCount = 1, bool abSilent = false, ObjectReference akOtherContainer = None) native

Parameters

 * akComponentToRemove: The component or form list of components the items to be removed must contain.
 * aiCount: How many components to remove. (Not items)
 * Default: 1
 * abSilent: If true, no message will be printed to the screen
 * Default: false
 * akOtherContainer: If not None, the removed item(s) will be moved into this ref's inventory
 * Default: None

Return Value
None.

Examples
Chest.RemoveItemByComponent(c_Leather, 5)
 * Remove 5 (or more) leather