Hello everyone, i had a problem with saving parts/models with Datastore. For example, a player builds a house with blocks in game, how would i be able to save the building when player leaves?
The thing is, you can’t.
I suggest you look into the idea of serialization .
1 Like
regexman
(reg)
January 1, 2022, 3:39pm
#3
You need to serialize the object with its properties as datastores only save UTF-8 characters, the 2 tutorials can help.
This article is the answer to the famous question “How to save objects using Datastore” and many other ways to word it.
If you played with Datastore for enough time, I think you already know that Instances such as parts and models ect. can’t be simply saved using :SetAsync(), which makes it hard to save objects. Most people, with games that are supposed to have slots and stuff on them that you want to save, get stuck when doing this, although, I think finding a way to go over this is quite eas…
I’m not self promoting but if you want an easy way, here
Okay, I know someone already made a tutorial about this, but it wasn’t really clear and this tutorial shows the easiest way of saving values like,
Vector3.new
Cframe
Color3
and etc.
Now you might easily just SetAsync right? Boom. An error popped up.
Why?
Because datastore can only save UTF-8 characters, which means it only stores strings, numbers and text, which means vector3,cframe is not a UTF-8 character
If you follow the 2 steps, you will be able to save positions, colors, etc.
Step…
Oh, i got it now. Thanks everyone, now i know how it works