Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Moonscript and Table Serilization?

I need to turn a Moonscript Class (so, in this case a Table) into a StringValue

Obviously, I will use JSON for Serilization (I don't need MetaTables, just the Value inside of them)

What Would my best approach to this be?

(I'm looking for a solution that would allow me to load any class from JSON

  • probably via constructor - and then serilize it on the fly
  • this shouldn't happen too often but atleast once every 8 seconds)

I'm a little confused on how I should implement this.. Ideas?

2 comments

2

I'm still not sure what you're trying to do here. JSONEncode takes Tables as parameters, how does that not answer your question? I'm legitimately confused.

0

I have references to other tables in that table. Note the REFRENCES part.

1 answer

I'm not exactly sure what it is you're looking for, but you can use the JSONEncode and JSONDecode methods of HttpService to do as their names suggest.

3 comments

1

I'm looking for a strategy on how to serililize a Moonscript Class into JSON. I don't need to know the encoding methods, but a strategy.

0

Since it's already a Table, can't you just pass it as an argument to JSONEncode? Or are you needing to serialze the script from an external source?

0

Problem is, the table contains references to so many other tables. I don't know what to do

This discussion is preserved as it was. New answers, comments, and votes are closed.