Object-to-Lua Serializer

I’m not sure if someone has done this (I’m sure someone has…), but anyway here’s mine. Given an object, it serializes the object (and its descendants) into Lua-executable code. It can even serialize properties that reference other objects within itself (e.g. a weld’s Part0 and Part1 properties).

Demo:

Plugin:

Please note that the plugin might be unstable. It’s literally 2 hours old as of writing this.

66 Likes

Thank you for writing something I have been too lazy to write myself :upside_down_face::upside_down_face:

3 Likes

Yeah I put it off for a long time due to the annoying complexity

4 Likes

I’m the video you used the command line and I was wondering how to make a script do so I can use it in a game

4 Likes

Hello, this plugin doesn’t seem to be working anymore. It keeps erroring “attempt to index nil with ‘GetAllProperties’” on line 62 of ObjectToLua.

I am almost 4 years late to answering this but since I’m here and had the same exact question but figured it out I figure I’ll post my findings

So assuming we’re using a model named BasketToLua like in the video, you’d want to make a server script as follows:

local model = require(game.Workspace.BasketToLua)()
model.Parent = workspace

Also might I add in case anyone was wondering as I was why there is an extra set of parentheses after the require statement:
require(game.Workspace.BasketToLua) --add () here

I found out it is due to the module script returning a function and us wanting to immediately invoke said function
if we didn’t want to invoke said function then just remove the extra parentheses
(something new I just learned)

Hope this helps somebody and sorry if I’m accidentally breaking any forum rules by replying to an old post :skull:

(also just wanna say big thank you to @sleitnick in general for making and sharing this with everyone :heart:)