So, I recently wanted to create a game that involves players into building. I want this to be saved to the Player’s datastore, however, I’m not quite sure how to do it. Since (what I’ve heard), you can only save Leaderstats values within regular DataStores.
So what my question is, I would like to know the best tips to create something that can save and backup this info!
I never make one, but when I think on this, i think thats better use numbers to save
For exemple
build with 1 part
The DataStore save the coordenates of the part and the part name/id in 2 DataStores
and make 1 DataStore for the coordenate (1,1) and one to the block of this coordenate, other DataStore for the coordenate (1,2), etc.
You use a table. You can use for i,v in pairs() to loop through every part (or model) and save something like an ID if you have multiple different items to build with, and a CFrame. You can’t save CFrames inside a datastore, so you need to convert it into a bunch of numbers. I don’t remember how to do this, but there are probably some guides on how to do it.
For loading, you simply loop through that table, get the item from the ID, and set the item CFrame to the saved CFrame. If you’re using a model, use the PrimaryPart CFrame for saving and loading.
Don’t use what rtvr56565 said, you only need 1 datastore. You can store the ID and CFrame in a table like this
--Data would be your table
Data[ID] = CFrameConvertedToNumber
Then you can loop through it with for i,v in pairs(). i will be the ID, and v will be the CFrame Number.