Can You Save Buildings With DataStores?

Hey, developers! I was wondering if you can save buildings with datastores. Take Bloxburg, Adopt Me, and other building games for example. When you leave, your build saves.

I know you can save leaderstats with datastores, so I’m wondering if you can do the same with buildings.

If you can’t please tell me what way you would need to do it, like another data saving method.

3 Likes

No, it is not possible to save instances. Although, you can save color, size, shape, and positions of the part.

Indeed you can save just about anything with datastores. You can’t save instances directly but you can save properties about those instances and then rebuild them. For that you will need to sterilize your building into a savable format. I am no expert on the topic so I shall link a few topics below, but you are basically taking properties (Location,size,color) and saving them to a table for each block. Then when someone joins the game again the server will rebuild the building using those properties.

Additionally depending on the size of the building you might need to compress some data so you don’t hit datastore limits. I have linked a resource below that might be of some aid.

6 Likes

Although you can’t, this will be involving OOP programming. There’s a tutorial about it. You should check it out.

It does not really. All what’s needed is knowledge about tables and maybe dictionaries in particular, since that’s what the idea of serialization is centered on.

2 Likes