How would i go around saving and loading values in folders?

(i hope this doesn’t come off as a “write me my code please” ask, i’m just at a total loss and have no idea where to go or what to do now)

hello all, i asked a question yesterday that was supposed to be about this, but i worded it terribly and tried to avoid talking what it was about, so here goes my second attempt

I’m working on my driving game and am right now trying to figure out a way to save certain values that relate to what the player has done with each car, like the distance driven, tire they’ve chosen for it, and the distance they’ve driven since the last time they’ve serviced the car.

Here’s how the folder structure should look like:
imagen_2023-02-11_200049944

Ideally, there should be able to be as many folders as there are cars inside of a folder in ReplicatedStorage named Cars

The way we can tell a car apart is if there is a model with a color3value named “CarColor” in it.

also, if possible to be able to have more than the values specified in the picture, if i decide to add more things to the cars that can be saved

oh yeah, the data folder doesn’t need to be inside the player, but i feel like it’d be the best place to be?? i dont know

ideally, the values should be readable by name, not just by index number, i don’t know if that’s possible, i hope it is :’’’’)

I genuinely just don’t know what to do now, i tried about three different ways to do this but i am not nearly as experienced enough with datastores to be able to do this

thanks to anyone who helps :’)

You may have to iterate through the descendants of the Folders and Check if the Value Instances are under the Class: ValueBase which refers to all Value Instances (Ex: StringValue NumberValue IntValue)

And so if that is found, insert the values into the a Table and use DataStoreService to save and load the items.

DataStoreService Resources:
Data Stores
Saving Data

would this let me read through each car’s values individually? or would they all be bunched up together, and would they keep their name?