Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I save and load a folder of player data?

So, I have a folder located in ReplicatedStorage that stores all the players data. Once they leave, I need to save that folder. When they rejoin, load that folder with their previous items in it. I'm thinking DataStores, but I think they only store values.

Is there a way that I can save and load a folder using DataStores? If so, how can I go about doing it.

1 answer

Serializing

Virtually saving an object is no different than saving a set of values that describes said object. In fact, that's the only way to save, load, transmit, or compare objects - by looking at the values, or properties that describe them. All of this entails serialization, which you can read more about here in an answer I gave on a similar topic.

Short story: Whatever you're saving could easily be compressed into sparse data that represents the exact object you wish to reference or recreate. Saving a tool? Save information about the tool with data store and reconstruct it upon loading it's saved properties. Or better yet, perhaps just save the name of the tool and index a table of tools for the saved name or ID! Whatever fits your scenario the best, there's a million ways to do the same thing.

If you have any questions, just leave a comment and I'll get back to it as soon as possible.

2 comments

0

Thanks for the response! I have a building system, and you can save the items you've placed. Right now, I'm saving all the properties of the items, which is in a folder. My issue is actually saving and loading the folder with the data. I've seen some models out there of a folder data structure, and they don't seem to work. I know this is not a request site, but I'm really stuck with how to go abou

0

about doing it.

This discussion is preserved as it was. New answers, comments, and votes are closed.