If a non-Sendable value, such as undefined, is passed to APIs that require a Sendable value, it will be handled according to the following rules.
If a non-Sendable value such as undefined is passed directly, it will either throw an error or be ignored depending on the API.
If an array containing non-Sendable values such as undefined is passed, it will be treated as Sendable by converting the non-Sendable values to null.
If an object containing non-Sendable values such as undefined is passed, it will be treated as Sendable by deleting the corresponding key-values.
If these behaviors occur, a warning message will be logged to the script console.
These behaviours are planned to throw errors instead in future updates.
Data types that can be saved to ClusterScript.state or sent using ItemHandle.send.
Specifically, values below are Sendable:
null
Notably, Sendable does not include
undefined
.Conversion from non-Sendable to Sendable
If a non-Sendable value, such as
undefined
, is passed to APIs that require a Sendable value, it will be handled according to the following rules.undefined
is passed directly, it will either throw an error or be ignored depending on the API.undefined
is passed, it will be treated as Sendable by converting the non-Sendable values tonull
.undefined
is passed, it will be treated as Sendable by deleting the corresponding key-values.If these behaviors occur, a warning message will be logged to the script console. These behaviours are planned to throw errors instead in future updates.
Conversion from Sendable to PlayerScriptSendable
When Sendable is sent to PlayerScript, values that cannot be treated as PlayerScriptSendable are converted to PlayerScriptSendable based on the following rules.
Example
Example