What is the best way to go about storing a bunch of data about a game?

Let's say that I wanted to make a RPG game with a bunch of quests and weapons, armor, tools (you get me) and I wanted to make sure it all saves and loads properly.

Would you just use JSON and decode and encode the string or just have a complex table like:



local data = {
	armor = {
		gold = false;
		leather = true;
		diamond = false;
	},
	
	stats = {
		level = 20;
		xp = 1332;
		strength = 2938;
	}
};

And how would you update the table value easily without having to copy and paste the table and set each value to the previous value from UpdateAsync (gold = prev.armor.gold)

2 comments

0

for that last part, couldn't you just do datastore:SetAsync() ? or am i just really misunderstanding the question