Saving values in different locations in a datastore

Hello!
So i have been trying to make datastores for values in my games so they save, but it doesnt seem to work. I got A LOT of values to save and some of them are in different folders than the other ones (still inside the player though).
So how exactly do i save all of them? Since they are all in different folders, do i use multiple datastores or save them one in a single one? If so, then how?
Thanks.

1 Like

put them all’s value in a dictionary then save it to a data store

1 Like

You would simple use tables like this:

local dataToSave = {
   Coins = 999,
   Inventory = {
      Pets = {},
      SomethingElse = {},
   },
   Stats = {
      Wins = 0,
   }
}

Etc this is just a random table but change it to match your game.

2 Likes