Is it possible to save the children of a folder with DataStore2?

I want to know if its possible to save the children of a folder using DataStore2. Instead of saving everything 1 by 1 it would be cool if that is possible and a lot quicker. I want to save it in kinda a little script. If it is possible may you please tell me how or give me some kind of devforum/youtube link?

1 Like

You can’t store userdata’s (the datatype ROBLOX uses for their Instances) in a datastore so I would assume DataStore2 doesn’t let you.

It might have a serializer that takes instances and puts them in some JSON string forum but I’m confident you will just have to iterate over the values in the folder and associate an index in the table with the name and value of the value instance.

There is already a page on the DevForum about this.

1 Like

Yes, but he is using the DataStore2 module, not the DataStore service. (Ok let me rephrase, he is using the DataStore Service but he is using it indirectly via a proxy called the DataStore2 Module)

Ah, you’re right. Though, I don’t see any logical way of DataStore2 creating an Instance of their Saved Data. (Such as Items inside of a Folder)

Yes. Use a function that’ll convert a folder into a dictionary, then save the returned dictionary.