A Simple DataStoreService wrapper with session backups and session locking.
Why AccountService?
- Easy to use
- Asynchronous
- Documented
- Session locking & Session backuping
Example of use:
local AccountService = require("./path/to/accountService")
local Template = { coins = 0 }
local AccountStore = AccountService.new("DataBlahBlahBlah", Template)
game.Players.PlayerAdded:Connect(function(Player)
AccountStore:AddAccountAsync(Player.UserId)
local acc = AccountStore.Accounts[Player.UserId]
print(acc)
end)
game.Players.PlayerRemoving:Connect(function(Player)
AccountStore:SaveAccountAsync(Player.UserId)
end)