Skip to main content

ValuePacker

Unpacks and packs values of various types into a table of numbers. This is useful for storing values in a format that can be easily serialized or transmitted.

Functions

UnpackValue

ValuePacker.UnpackValue(
Valueany,--

The value to unpack

ValueTypestring--

The type of the value to unpack

) → UnpackedValue--

The unpacked value as a table of numbers

Unpacks a value of a given type into a table of numbers. If the type is not supported, returns an empty table.

PackValue

ValuePacker.PackValue(
UnpackedValueUnpackedValue,--

The unpacked value as a table of numbers

ValueTypestring--

The type of the value to pack

) → any--

The packed value of the specified type

Packs a table of numbers into a value of a given type. If the type is not supported, returns nil.

Show raw api
{
    "functions": [
        {
            "name": "UnpackValue",
            "desc": "Unpacks a value of a given type into a table of numbers. If the type is not supported, returns an empty table.",
            "params": [
                {
                    "name": "Value",
                    "desc": "The value to unpack",
                    "lua_type": "any"
                },
                {
                    "name": "ValueType",
                    "desc": "The type of the value to unpack",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "The unpacked value as a table of numbers",
                    "lua_type": "UnpackedValue"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 225,
                "path": "src/Packages/ValuePacker/init.luau"
            }
        },
        {
            "name": "PackValue",
            "desc": "Packs a table of numbers into a value of a given type. If the type is not supported, returns nil.",
            "params": [
                {
                    "name": "UnpackedValue",
                    "desc": "The unpacked value as a table of numbers",
                    "lua_type": "UnpackedValue"
                },
                {
                    "name": "ValueType",
                    "desc": "The type of the value to pack",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "The packed value of the specified type",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 241,
                "path": "src/Packages/ValuePacker/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "ValuePacker",
    "desc": "Unpacks and packs values of various types into a table of numbers. This is useful for storing values in a format that can be easily serialized or transmitted.",
    "source": {
        "line": 9,
        "path": "src/Packages/ValuePacker/init.luau"
    }
}