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

How would I save blocks with datastore?

I have a building and mining system, where players can create worlds and things. That works fine, but I want it to save so players can come back and continue on the world. I know how to save values with datastore, but how would I save objects like this?

4 comments

0

Save a table with multiple values that you can use. Save all the parts and their positions into that table and when loading it just load the same parts and positions..

0

The only way to do that is turn the objects into data, like a string or numbers in table, and then turn them back into objects when you load the data. Edit: ffejyos beat me to it

0

oh

0

You probably need a serializer/deserializer if you worry about datastore limits.

1 answer

I would usually say to create a "model-to-script" script, however with datastore limit concerns I suggest JSONEncode and JSONDecode to turn a table into a string. Don't actually put the object in the table, instead put a number or code that you can code a function to recognize and replicate the object from that.

1 comment

0

data store convert tables to JSON for you. No need to do it yourself

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