# sm.container.collectToSlot

Performs a collect operation to a specific slot.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
sm.container.collectToSlot(
    container,
    slot,
    itemUuid,
    quantity,
    mustCollectAll
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.container.md#collecttoslot)

**Availability:** Server only

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `container` | [Container](../Game-Script-Environment/Userdata/Container.md) | The container. |
| `slot` | integer | The container slot. |
| `itemUuid` | [Uuid](../Game-Script-Environment/Userdata/Uuid.md) | The uuid of the item to be added. |
| `quantity` | integer | The number of items to be added. |
| `mustCollectAll` | boolean | If true, only add items if there is enough room. If false, add as many items as possible. Defaults to true. (Optional) |

**Returns:**

| Type | Description |
| --- | --- |
| integer | The number of items successfully added. |
