sm.container.spendFromSlot
Performs a sm.container.spend operation from a specific slot.
Kind: Function
Environments: Game
Game
sm.container.spendFromSlot( container, slot, itemUuid, quantity, mustSpendAll )
Availability: Server only
Parameters:
| Name | Type | Description |
|---|---|---|
container |
Container | The container. |
slot |
integer | The container slot. |
itemUuid |
Uuid | The uuid of the item to be removed. |
quantity |
integer | The number of items to be removed. |
mustSpendAll (optional) |
boolean | If true, only remove items if there are enough. If false, remove as many items as possible. Defaults to true. (Optional) |
Returns:
| Type | Description |
|---|---|
| integer | The number of items successfully removed. |