Easy Datastore
Easy Datastore, the new and superior datastore module
I know the pain !
Datastore modules can be complex, tricky, and time-consuming! Remember all those times you went to documentation-long websites? All those hour-long YouTube tutorials? I also hate that! Letâs stop this nonsense!
SOOOO easy!
Easy Datastore is designed with extreme ease! No more long documentation! only 3 lines of code:
Module.get()
Module.set()
Module.save()
Improve script clarity and reduce the amount of effort you need to achieve simple functionality.
What about alternatives?
Alternative data modules such as
- Profile Service
- Datastore 2
- etc
Not only are these alternates more complex, but they are actually less optimized too! For example, ProfileService and DataStore 2 have an inferior autosaving system. Constantly autosaving is a bad practice, and Easy Datastore has the Module.save() function to align with best practices.
Setting up your data is clear, quick, secure, and easy! Letâs add some basic currencies to my datastore!
- Simply add your currencies to the data folder!
- Give them the attribute âvalueâ with the type of whatever you want this datastore to store!
- Since there is no attribute for table, if you want to use a table, set the value to the string âtable.â
- If you want a dictionary, simply parent the folders inside of each other:
Get() value of coins!
local module = require (script.Parent.economyModule)
game.Players.PlayerAdded:Connect(function(plr)
local coinCount = module.get(plr, "Coins") -- 0
end)
Set() value of coins!
local module = require(script.Parent.economyModule)
game.Players.PlayerAdded:Connect(function(plr)
module.set(plr, "Coins", 10)
module.get(plr, "Coin") -- 10
end)
save() is recommended, but optional autosaving.
- You should call the module.save() after major events such as leveling up!
local module = require(script.Parent.economyModule)
game.Players.PlayerAdded:Connect(function(plr)
-- Player levels up here.
module.save(plr)
end)
Easy Datastore is designed to be extremely robust, despite its simple appearance. Here are the main attributes of Easy Datastore that ensure data.
-
Cache Loading
It stops malicious users from slowing down your servers. When a user leaves your game and joins quickly afterward, it will load their data without having to make a datastore call. This prevents attacks and keeps your game efficient! -
Error handling
The module manages any errors through a series of attempts. By default, the module will repeat calling for the data five times. You can adjust this inside the data script. -
Efficient data management
The module stores all data within the same script that saves it. Any sets you call are stored during runtime and saved only when they leave the game. This allows for quick and efficient data saving as it doesnât have to retrieve the data from external sources. -
Anti-data corruption
Before saving player data, the module checks if the data itâs about to save is inaccurate through updateAsync. The data stores the timer when players first join your game and compares this time with the returned updateAsync values to ensure that you are not overriding existing data with less data. -
data compression
The module utilizes HttpsService:JSONDecode and HttpsService:JSONEncode to save space within your datastores. When data is encoded, it generally takes up less storage, allowing for a more robust system. -
Bind to close
The module utilizes bindtoclose() to save data in the event of a server structure. -
SUPER autosaving
Easy Datastore utilizes an innovative mechanic for autosaving in your game! Most datastore modules use bad practices, such as constant autosaving! Easy Datastore only autosaves when you, as a developer, think it should! -
Data recovery during run time
Whenever Easy Datastore autosaves, it not only secures your players data in the event of a crash but also fixes corruption or outdated information during runtime! This means that when players are experiencing data issues, the module is so robust that it is able to handle it itself without requiring the player to rejoin, like the competition.