getbspval Synchronous

Read a BinaryString reflection property. Choose Base64 output when the bytes must be printed, stored in JSON, or sent through a text-only channel.

Syntax
Luau
getbspval(instance: Instance, property: string, base64: boolean?) -> string

Parameters

Function parameters
ParameterTypeDescription
instanceInstanceInstance owning the BinaryString property.
propertystringCase-sensitive name of a BinaryString property.
base64boolean?Optional boolean; true encodes the raw bytes as Base64.

Returns

string

Raw binary bytes as a Luau string, or printable Base64 text when base64 is true.

Usage notes

The function rejects properties of other types. A property can exist yet be unavailable on a particular class or runtime build.

Example

Example
Luau
local terrain = workspace.Terrain
local ok, encoded = pcall(getbspval, terrain, "SmoothGrid", true)
if ok then
    print("Base64 characters:", #encoded)
else
    print("Binary property unavailable:", encoded)
end
Kawaii documentation