InstanceToData, A Way to Turn Instances Into Tables and Vice Versa

InstanceToData

Roblox | GitHub

Hello! Just wanted to share this small module I decided to make. It’s useful for saving parts to databases and such. Please report any issues you encounter.

How to use:

local InstanceToData = require(path.to.module)
local PartToEncode = workspace.Part -- Example

local EncodedPart = InstanceToData.Encode(PartToEncode) -- This is a table containing all the parts properties, tags and attributes
-- ^^^^ Can be saved to databases
local DecodedPart = InstanceToData.Decode(EncodedPart) -- This will clone PartToEncode, and insert it into the game.
-- ^^^^ Can not be saved to databases

Planned Features

  • Mesh support Added in update #1
  • Model support

Do not hesitate to leave any feedback!

1 Like

Update #1

I’m happy to announce that InstanceToData now supports MeshParts! Enjoy.

ChangeLog

  • Added “Shape” property to EncodedParts
  • Added MeshPart support
  • Added “RenderFidelity” and “MeshId” properties to EncodedMeshParts.