Appearance
game.storage
Per-script storage. Names are 1..80 ASCII letters/digits/_/-/. and must not be . or ... Payloads are limited to 2 MiB.
Native global — no require.
read
function · read(name: string): string?, ErrorMessage?
Per-script storage. Names are 1..80 ASCII letters/digits/_/-/. and must not be . or ... Payloads are limited to 2 MiB.
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
Returns
| Type | Summary |
|---|---|
string?, ErrorMessage? | — |
write
function · write(name: string, data: string): boolean, ErrorMessage?
Returns false, error on failure.
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
data | string | — |
Returns
| Type | Summary |
|---|---|
boolean, ErrorMessage? | — |
remove
function · remove(name: string): boolean, ErrorMessage?
Returns false, error on failure.
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
Returns
| Type | Summary |
|---|---|
boolean, ErrorMessage? | — |
path
function · path(name: string): string
Empty when the name or host is unavailable.
Parameters
| Name | Type | Summary |
|---|---|---|
name | string | — |
Returns
| Type | Summary |
|---|---|
string | — |