Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utility Functions #16

Closed
CleverSource opened this issue Dec 10, 2018 · 3 comments
Closed

Utility Functions #16

CleverSource opened this issue Dec 10, 2018 · 3 comments

Comments

@CleverSource
Copy link

CleverSource commented Dec 10, 2018

Make it so that you can easily load a backup onto a main datastores or even if the player completely loses data it fully loads the backup and if there isn't a backup it goes through each old key until one of them works and loads that one. In the chance everything is lost how exactly can data be retrieved because it takes a lot about how this can prevent data loss but doesn't say much about giving a user their data back.
Also allowing us to use the MasterKey as a normal DataStore would be a great feature and using it with :OnUpdate() I feel as if OnUpdate should return the key saving as well. Here's an example:

DataStore2.Combine("MyMasterKey", "Coins", "Gems")

local Coins = DataStore2("Coins", Player)
local Gems = DataStore2("Gems", Player)

-- Maybe have it as a variable in DataStore2???
DataStore2.MasterKey:OnUpdate(function(SavingKey, Value)
       print(SavingKey, Value) -- If coins saved with value 100 it'd print Coins, 100
end)

Coins:Increment(100, 0)
-- etc.

-- The idea of using MasterKey as a normal datastore:
local Master = DataStore2("MasterKey", Player)

print(Master:Get().Coins) -- Use it like a table.

What I sent you on DevForum for reference:
image

@Kampfkarren
Copy link
Owner

-- The idea of using MasterKey as a normal datastore:
local Master = DataStore2("MasterKey", Player)

print(Master:Get().Coins) -- Use it like a table.

You should already be able to do this? Combined data stores still use normal DataStore2 internally.

@CleverSource
Copy link
Author

Never knew that, thanks for the info!

@Kampfkarren
Copy link
Owner

Closing--combined data stores soon becoming the default as well as the berezaa method no longer being guaranteed make this obsolete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants