Skip to content

Latest commit

 

History

History
76 lines (72 loc) · 1.83 KB

README.md

File metadata and controls

76 lines (72 loc) · 1.83 KB

roblox_pack.luau

a library for converting Roblox data types to and from text

NOTE: Instances are converted to and from paths.

Usage:

Call pack to convert data into a string. pack expects a table, so wrap your value(s) around a table if necessary.

roblox_pack.pack(data: {any}) -> string

Call unpack to convert a packed string back into the original table passed.

roblox_pack.unpack(packed: string) -> {any}

Example:

local roblox_pack = require(game.ReplicatedStorage:WaitForChild("roblox_pack"))
local data = {Vector2.zero, Vector3.zero, Vector2.new(0, 10)}
local packed = roblox_pack.pack(data)
print(packed)
local unpacked = roblox_pack.unpack(packed)
print(unpacked)

Output:

example output

Supported data types:

Luau:

  • nil
  • boolean
  • number
  • string
  • table

Roblox specific:

  • Axes
  • BrickColor
  • CatalogSearchParams
  • CFrame
  • Color3
  • ColorSequence
  • ColorSequenceKeypoint
  • DateTime
  • DockWidgetPluginGuiInfo - properties are read only
  • Enum
  • EnumItem
  • Faces
  • FloatCurveKey
  • Font
  • Instance - NOTE: Instances get converted to and from paths
  • NumberRange
  • NumberSequence
  • NumberSequenceKeypoint
  • OverlapParams
  • Path2DControlPoint - TODO
  • PathWaypoint
  • PhysicalProperties
  • Random - no way to transfer internal state besides seed
  • Ray
  • RaycastParams
  • RaycastResult - not constructable
  • RBXScriptConnection - not constructable
  • RBXScriptSignal - not constructable
  • Rect
  • Region3 - TODO
  • Region3int16 - TODO
  • RotationCurveKey
  • Secret - Not applicable
  • SharedTable - TODO
  • TweenInfo
  • UDim
  • UDim2
  • Vector2
  • Vector2int16
  • Vector3
  • Vector3int16