Datastore2 dictionary saving

  1. What do you want to achieve? I want to save a dictionary with all the player’s data to a datastore2

  2. What is the issue? I have no idea how to save a dictionary to a datastore 2, I have searched it up, but for me, datastore 2 is much more complicated than normal datastore

  3. What solutions have you tried so far? I have searched for an answer, but I don’t find anything about datastore 2 dictionary saving.

Can someone please briefly explain for me so I understand how to save a dictionary through datastore 2!

1 Like

I’ve never used DataStore2, but from what I understand it uses a basic queuing/cacheing system that basically temporarily holds all data in a regular roblox table until it’s able to be successfully saved by DataStoreService.

local coinStore = DataStore2(“coins”, player) --// Equivalent to GetAsync on a “coins” datastore.

coinStore:Set(100) --// Equivalent to SetAsync, except you don’t need to provide the userId (or player?) as an argument, because you’ve already input it when you originally fetched the datastore. I recommend reading this post…

You just save it like any other value: DataStore2:Set(yourTableHere). There’s no special thing for tables.

In the future, you should use the search bar before making a new topic. The third result when you search up “Datastore2 table saving” in the search bar has an answer: How to save Dictionary using DataStore2?. (Dictionaries are just a type of table)

6 Likes

I’ve watched that video, didn’t show how to save tables tho.

I will try that right away!! Thank you for your reply!

1 Like

Could you maybe help me with one thing? I’ve already done my datastore but it wasn’t a datastore 2, could you help me convert it to datastore 2? I have almost no idea how it works, and I’m not giving up either.

this gave me a head start, but I don’t know where I should put the code.

Also, I will edit from table to dictionary in the topic. typo…

You might find this of help: How to save Dictionary using DataStore2?

this was already posted by @posatta

Feel free to mark their answer as the solution if that’s the case using the squared tick-box.