What do you want to achieve?
My goal is to save all of the string values in this folder, and load it all back in exactly how it is when called.
What is the issue?
I understand that instances can not be saved using datastores, so I need help on how to compile all the values in the folder, and how to re-import them when called.
Just a heads up that the folder setup above is an example, in my game these folders are generated [on the server] when players do certain actions, they can add up to 10 questions, which means that within the QuestionHolder, there is a possibility of more then just the “Question1” such as “Question2”, “Question3”, and so on.
What solutions have you came up with?
From reading other posts with a similar issue to mine, I found that I need to iterate through the folder and find all of the values I’m wanting to save (StringValues). From there, I can then insert them into a table and save the table as a JSON?
From there I am stuck on if this is a viable solution, and how I would go about transforming the saved table to the folder setup as shown in the image above.
I think this is how the finished table should look like because since I want to be able to load it in as it is now, I want to be able to know which values are for what:
Quiz = {
Questions = {
Question1 = {
RealAnswer = "Real answer here",
FakeAnswer1 = "Fake answer 1 here",
FakeAnswer2 = "Fake answer 2 here",
FakeAnswer3 = "Fake answer 3 here"
}
},
QuizName = "Quiz name here",
QuizDescription = "Quiz description here"
}
I am new to datastores and am still learning so any help would be appreciated, thank you!