DataStore Issue

Alright so I created the dataStore that saves pets but it’s makes instance only of the last pet that player got, how can I save the duplicated pet stats? For example: Default pets has the same boost, level, exp etc how can I save these duplicated pets too?

I assume you are using a dictionary and the key is the pet name, try saving an array of dictionaries with the info of the pet in them.

Yeah it’s the thing but it saved only the first pet with the same name instead of his duplicates, any ideas how to fix it?

As I knows it’s because everything is the same(Pet Name, values) and it won’t save duplicates, but as the default player can hatch egg x1000 times and ~20 times same pet with same stats, but the thing is player will lose all his pets and get only a 1 of it

Can you show us your saving script?

Can you show the part where you call GetAsync & SetAsync or UpdateAsync?

I don’t use GetAsync etc, it’s a dictionary.

How do you save & get the data then?

What it does? Shouldn’t it just be dataStore:SetAsync(player.UserId, dataToSave)

Please read it again: dataStore.SetAsync, player.UserId. You can save it by table like I’m using also, I don’t see any problems with it lol

Oh, ok. Anyway, how do you get the data from datastore?

I mean, where you call GetAsync to retrieve the data from the DataStore.

It’s saves on table and you should’t use GetAsync on dictionary at all.

GetAsync is used to retrieve the data from the DataStore. (ex. When you join it’s used to load data). What’s the point in using DataStores without using it? It’s the only method to load the saved data.