# sm.storage.save

Saves any Lua object with a given key. The <em>key</em> can be any lua object.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
sm.storage.save( key, data )
```

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

The data will remain stored after closing the world, and is retrieved using [load](../Game-Script-Environment/Static-Functions/sm.storage.md#load), provided the same key.

> **Note:**
> The data is stored globally <strong>within the current mod</strong>. As of such, keys will not collide with external mods and scripts.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `key` | any | The key that will be used to get the data. |
| `data` | any | The data to be stored. |
