How to save blocks of building system

:warning: This is not for beginners, you need to know basic scripting or you won’t understand this tutorial
Required Basics:

  • DataStore
  • How to save in DataStore
  • Building system ( this is not a tutorial for building system)

:blue_square: This is a long tutorial but you will understand how to save blocks for sure

So basically, you cannot save non UTF-8 characters, meaning you can only save UTF-8 Characters

What is UTF-8?

Its a name given to strings,tables and numbers in simple, like you can only save numbers, tables or strings in a datastore, you cannot save objects/instances

How do I make blocks save, if I cannot save objects/instances

You can, its simple, don’t panic, here is how:

For games like building system like bloxburg
You have 2 ways:

  • Object-Name and Position
  • Object-Properties and Position

So if you have a ton of models or meshes in game, you keep all of them in a folder, and then when you save it, you save the table, which have the name and position of all the objects

Did not understand?

See here’s how:
Make a table, like this:

local tabletosave = {
  ["ObjectName"] = "Car",
  ["Position"] = {
   ["x"] = 5,
   ["y"] = 15,
   ["z"] = 100
   }
}

Now you have an idea maybe?
So, to save models, you can save their name and position
Later, find which model was there by using their name, and placing the model in the same position using the tabletosave["Position"] table, its quite easy, and this is how many games who save their building blocks are made

But if your saving blocks, you can do:

local tabletosave = {
  ["Size"] = {
   ["x"] = 5,
   ["y"] = 15,
   ["z"] = 100
   },
  ["Position"] = {
   ["x"] = 5,
   ["y"] = 15,
   ["z"] = 100
   },
   ["Material"] = tostring(block.Material)
}

You can do this, where you save size of block and position of block, with material, you can also include Anchored,Transparency and even more properties too

Also you cannot save block.Material, which is Enum.Material.Plastic, its not a string, so what you do is use tostring() on the material, you get Plastic, then you can later use Enum.Material["Material"] there are even more ways

Make sure you save strings,numbers and tables(of numbers or strings), you can save a table of arrays or a table of dictionary in data store, this is a tutorial on how to save, but not on how to save in data store, so I am not including that topic here

How can I find whose blocks are built my player for saving them?

This is simple too, make a folder in workspace named “Blocks”, and in that a script which adds a folder with the name of player, so each time the player builds, keep the blocks.Parent as workspace.Blocks.PlayerName, later you can use loop to get all the parts of the folder, then save it

How to save BrickColor?

Save the value using tostring() then you get “Really Red” as brickcolor, if its red, it gets the string, so you can save it

Now, how to keep it back? its simple
You use BrickColor.new() -- color name to keep colors
But now keep BrickColor.new(“BrickColor”) – the saved color name of your block, you get it
This is is all working, and I too made a building system game from this, don’t worry if you have any error comment below, I’ll try to answer them

6 Likes

first of all,

local tabletosave = {
  ["Size"] =  -- you forgot to add a "{" here
   ["x"] = 5,
   ["y"] = 15,
   ["z"] = 100
   },
  ["Position"] = {
   ["x"] = 5,
   ["y"] = 15,
   ["z"] = 100
   },
   ["Material"] = tostring(block.Material)
}

and
image
grammar lol

4 Likes

Although I understand that this is a tutorial you wanted to make for people, I have to agree with @ItzMeZeus_IGotHacked that it’s basically a copy of @starmaq’s tutorial. This tutorial doesn’t provide any means of making a building system, but only a small snippet of code of how to store information. You also didn’t properly explain how to load info and how to get them correctly. There’s a huge amount of saving tutorials already.

Apologies if this came out as harsh.

4 Likes

Thanks, you are a life-saver!
I have been wondering how games save your building/plot progress, forever! :grinning:

2 Likes

Look, I never told this is a tutorial for making building system

Second, not everyone can explain well, some explain good, others not very good, you cannot judge someone by their way of telling, and if your not interested in tutorial, you can leave, but I made this tutorial for beginners, and it might not be explained well, but I did not my best to teach developers

3 Likes

Fixed them, thank you for your correction

1 Like

What? Didn’t you just say before this wasn’t for beginners?

1 Like

Yes, but this is not for developers who don’t know scripting at all, you need to know basis atleast, or you might not understand what I told

1 Like

Then change that warning to

REQUIRED KNOWLEDGE:
basics, of course
DataStore -- how could you come to this tutorial if you didn't know this
3 Likes

Can you please stop?
I am explaining how to save building system blocks, but not how to making building system

I know what I am doing, and I know what I made a tutorial on

I’m not stopping until you admit you copied someone’s tutorial and made it simple to understand. I did the same mistake as yours and my topic got flagged as well.

2 Likes

It doesn’t look like a copy to me, but I did not try my best to compare both.
From my perspective he is just explaining the same content in a different way (a simple way I’d say), so it’s kind of heavy to say it’s “copying” someone.

That still doesn’t make sense. One time I made a tutorial based on someone’s tutorial in which I explained it easier, and then then OP got mad and my topic got flagged. This is literally the same thing as how this dude is doing.

I believe the OP in your case was the wrong one, it’s like one teacher getting mad at another one for teaching the same content, it doesn’t make sense to me.

Edit: For example, if you search on YouTube how to make a leaderboard on studio you’ll find a lot of videos teaching the same thing, some may be easier and others more complex, but they still don’t have the rights (I guess) to copyright or take down the others for making a video about the same content with the reason being “I did a video about the same content, just a bit more complex and in depth than yours, before you did yours, so please remove your video as it’s not needed”.

I wouldn’t really call this a copy, that would be a little inaccurate.

Imagine harassing somebody just because he taught the same thing that others did but in a shorter post.

And that’s no excuse, just stop harassing the guy for once.

1 Like

Whatever, but when someone asks a similar question about this, I wouldn’t redirect them to this tutorial.

Thank you for the criticism! I love your insult.

I don’t think you really need to include an explanation of the Unicode format, but this not is exactly true. UTF-8 is just a data storage format(specifically for text), sort of like PNG or MP4. I also think you could have also possibly included an actual code example instead of just telling people how to use tables, buuut, that’s just a few nitpicks I had.

3 Likes