Mod:Creation Kit/RemoveComponents - ObjectReference

Member of: Mod:Creation Kit/ObjectReference Script

Removes the a certain count of a specified component from the container's inventory, scrapping objects as necessary, and returning the change to the container.

Syntax
Function RemoveComponents(Component akComponent, int aiCount, bool abSilent = false) native

Parameters

 * akComponent: The component to remove.
 * aiCount: How many components to remove. (Not items)
 * Default: 1
 * abSilent: If true, no message will be printed to the screen
 * Default: false

Return Value
None.

Examples
Chest.RemoveComponents(c_Leather, 5) Player.RemoveComponents(c_Leather, 5, true)
 * Remove 5 leather, scrapping items and returning remainder to Chest
 * Remove 5 leather, scrapping items and returning remainder to the player, but with no messages on screen