Data Stores 2 saving / loading issue

Hello! so i recently switched my data stores to use Kampfkarren DataStore2. The issue im having is that I am saving a table with data inside of it for DataStores2 and sometimes, a players data just gets reset. Their data does not get reset to the default, if this was the case the players who joined my game will get reset to their default characters, accept they get reset to a previous version. I updated the key (the userDataStoreName variable) often so this might of been the cause but how do I prevent this from happening in the future? Also is the way I am going about saving data efficient with the tables I am using, or is their a flaw in my system that I cant seem to spot

Code:

If it gets set to an old version then it must be saving a cached version or it may not be saving. It could just be datastore2 loading a cached version of the character since the player joined the exact same server before.

yea that sounds like the problem. Is their any way i can fix it?

I have never had caching issues with normal data stores and it can be attempted to try and use normal datastores in a safe way.

Why tho?

Any benefit DS2 had is now gone with DataStore v2 update. DS2 is also unsupported.

Personal recommendation: I would use ProfileService, it supports DataStore v2 and is constantly updated. (along with a lot of other features like session locking)

Your right, i was just recently aware of this change. Converting my game (that is somewhat live) to roblox’s original data stores might cause some issues. Including the obvious data loss. Not to mention im sure i’d have to learn it

Data stores 2 seemed more convenient at the time because it was relatively easy to use. The thing is, i dont know what my system is doing wrong

At this point I would merge your data to ProfileService.

I highly recommend it. It’s really easy to learn and it prevents so many edge cases that can cause you nightmares later on.

ah okay, where do i find this module