If a non-PlayerScriptSendable value, such as undefined, is passed to APIs that require a PlayerScriptSendable value, it will be handled according to the following rules.
If a non-PlayerScriptSendable 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-PlayerScriptSendable values such as undefined is passed, it will be treated as PlayerScriptSendable by converting the non-PlayerScriptSendable values to null.
If an object containing non-PlayerScriptSendable values such as undefined is passed, it will be treated as PlayerScriptSendable 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 sent using PlayerScript.sendTo.
Specifically, values below are PlayerScriptSendable:
null
Notably, PlayerScriptSendable does not include
undefined
.Conversion from non-PlayerScriptSendable to PlayerScriptSendable
If a non-PlayerScriptSendable value, such as
undefined
, is passed to APIs that require a PlayerScriptSendable 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 PlayerScriptSendable by converting the non-PlayerScriptSendable values tonull
.undefined
is passed, it will be treated as PlayerScriptSendable 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 PlayerScriptSendable is sent to ItemScript, values that cannot be treated as Sendable are converted to Sendable based on the following rules.
Example