cxmeel / packager

Packages up an Instance or tree of Instances into a single table.

Home Page:https://csqrl.github.io/packager/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Packager

Packages up an Instance or tree of Instances into a single table. Supports linking of Instance-based properties to their corresponding Instance (as long as the Instance is within the tree being packaged).

Usage

local Packager = require(script.Parent.Packager)

-- Create a new Packager from the latest Roblox API dump
local packager = Packager.fetchFromServer()

local tree = packager:CreatePackage(workspace.MyModel)
--[[
  {
    Refs = {
      [MyModel<Model>] = "AABBCC",
    },
    Tree = {
      Name = "MyModel",
      ClassName = "Model",
      Ref = "AABBCC",
      Properties = {
        PrimaryPart = {
          Type = "Ref",
          Value = "BBCCDD",
        },
      },
      Children = {
        {
          Name = "Part",
          ClassName = "Part",
          Ref = "BBCCDD",
          ...,
        },
      },
      Attributes = {
        OwnerId = {
          Type = "number",
          Value = 1233456789,
        },
      },
      Tags = { "Tag1", "Tag2" },
    },
  }
]]