Reading and adding to datastore without pulling everything

image

This is what I want my datastore basically looks like now.

Say I want to play on my Nov 1st save. How would I load only it? Because I think it’s wasteful to load all of my other saves if I only want to play on one. What about saving? Currently I just overwrite.

I also need to be able to get the save names, so I can display them, along an easily accessible image icon link of every save so I can display them too.

Would I need to restructure my data? If so, how?

Thanks!

1 Like

Currently, the only way would be to save each entry under saves under its own key

1 Like

is “dataStore” in the second line the key?

local DataStoreService = game:GetService("DataStoreService") --Gets the DataStoreService
local dataStore = DataStoreService:GetDataStore("dataStore")

If so, how do I display all of them with their own icon?
image

my grid will look something like this :point_up:

Image credit goes to: Sorting UI Grid Layout

No, that’s the name of the datastore. The key is the first argument when you go to call update/setasync dataStore:SetAsync(key)

You would have to give each entry its own unique key though, and you’d have to keep track of these keys somehow.

1 Like

You can just access the specific value in the table and load it in my just navigating to it in the table. I don’t see why it shouldn’t work, however I have no idea how your system works deeper then what you showed. The way I save data for my game, that is only bools, numbers and strings is by having physical properties under the player. This allows me to not even have to access the datastore to get or modify a value. And when I want to save I iterate over the physical items with the values and save them into an actual datastore. Then use the datastore to create a new set of physical items with the datastore values. Probably won’t work for you case however

In my datastore, under each “save_[date here]” is a serialized folder of like 50+ parts, all with their positions, rotations, colors, materials, shapes, custom physical properties, etc. saved. Do you think it could work?

You can just access the specific value in the table and load it in by just navigating to it in the table.

Can you elaborate? Thanks!

image
but wouldn’t that mean every player has access to them? I’m sorry if I’m not understanding something, this is my first time with datastores :p

You can access the specific table for the saved time then loop through there, you said there you have all the info of the saved part locations and whatnot.

I’m a you know the basics tables if not I can help