Skip to content

a library for converting Roblox data types to and from text

License

Notifications You must be signed in to change notification settings

TechHog8984/roblox_pack.luau

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

a library for converting Roblox data types to and from text

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages