# Container.collect

Adds a quantity of a given item to a container.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
container:collect( itemUuid, quantity, mustCollectAll? )
```

[Open the full Game reference](../Game-Script-Environment/Userdata/Container.md#collect)

**Availability:** Server only

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `container` | [Container](../Game-Script-Environment/Userdata/Container.md) | The container. |
| `itemUuid` | [Uuid](../Game-Script-Environment/Userdata/Uuid.md) | The uuid of the item. |
| `quantity` | integer | The number of items. |
| `mustCollectAll` *(optional)* | boolean | Must collect all items for the transaction to be valid. Defaults to true. (Optional) |

**Returns:**

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