How to use DataStore2 - Data Store caching and data loss prevention

It uses BindToClose, and that’s the best that’s possible.

3 Likes

I have another question. If I wanted to clear everyone’s data, am I correct in thinking that changing the master key for the combined data stores will do that? Or do I still need to change every key?

1 Like

What would be really useful is to be able to put a minimum tick to get from.
So you can “reset” data for version updates or seasonal content without losing records of the past. And without keeping a different datastore for each iteration.

1 Like

Is it fine to combine a bunch of datastores to one master key? I’m making a game and I need a lot of different data saved so I’m wondering if too many will cause it to throttle and fail. Thanks! :slight_smile:

EDIT: Also, if I do :Save() on one Datastore inside of a master key, does it save for every datastore or just that one?

1 Like

Yes–this is what you should be doing.

Should save them all.

2 Likes

Just changing the master key works.

2 Likes

Is there any other way resetting data than changing the key?

1 Like

There is not currently.

1 Like

I’m not sure what you’re asking. To combine data stores, right after requiring DataStore2 write:

DataStore2.Combine("DATA", "coins", "levels", "whatever", "etc")

And then just use the stores as normal

DataStore2("coins", player)
DataStore2("levels", player)
DataStore2("whatever", player)

Lets suppose that for some reason, there are 2 scripts:

One script contains:
DataStore2(“coins”, player)
DataStore2(“levels”, player)

Another script contains:
DataStore2(“whatever”, player)

In that case, how DataStore2.Combine should be used? It have to be used in both scripts right after requiring DataStore2?

2 Likes

The one script has:

DataStore2.Combine("DATA", "coins", "levels")

The other has:

DataStore2.Combine("DATA", "whatever")

3 Likes

Thanks I will trust the module and use it in my new game BloxyCity - Updates

Greetings kevini44

1 Like

Is Crazyman32s DataStore editor compatible with DataStore2?

1 Like

Wow! Thanks for the information, never knew about this until you posted this. :slight_smile:

1 Like

Pretty dumb question, but how would you take something from an IntValue with DataStore2? I never used this before, but saw the tutorial listed and have some understanding of it now, like how I used to do it: player.fjweoifgjgri.Value = player.fjweoifgjgri.Value - 50

1 Like

Can you access the DataStore of an offline player?

1 Like

No, that’s not how datastores work. I don’t even think you can make an offline datastore since if I’m not mistaken roblox removed a lot of the os file manipulation functions.

1 Like

You can access normal datastores of offline players with their key (probably their UserId for example). But DS2 requires the player instance, which makes that not possible

1 Like

Oh sorry I misunderstood your question, I thought you meant the roblox studio offline mode where you dont need wifi

1 Like

oh no, not that lol. Although it is possible, you can simulate local datastores for offline studio there is a thread for it I think :slight_smile:

1 Like

Yes, you just need backtrack the system to determine how it wrote the Scope and the Key to access the datastores you want to see.

This is probably a good thing to know how to do with the new European Data Privacy laws.

2 Likes