Hi, I’m Finster (FinsterHorizon), and today I’ll introduce you to my first public module, SimpleData.
NOTICE: SimpleData is still currently in a very early state, and everything is subject to change, however I assure you updates should never affect any scripts.
What is SimpleData?
SimpleData is a new module I’ve made to make using Datstores easier for people ( and totally not just for me since I can never remember how to use them )
What does it do?
SimpleData includes 2 straightforward features, .Save() and .Load()
As you can tell, these simply allow you to Save and Load from DataStores.
How do I use it?
At the top of the Module, you’ll see:
SimpleData.StoreKey = "YourDataStoreHere1" -- Put the DataStore you want to save to here!
This will be the only setting in here that you need to change, I advise you change it immediately, as if you wish to have multiple SimpleData nodules, it would be awful for them to overlap with one another.
Under the SimpleData module is the readme script, this contains information such as pre-made data formats for SimpleData and support information (Support info is currently only my username since I’m writing this post right now, will be updated in 1.1)
Format for loading data:
local SimpleData = require(SimpleDataLocation)
local playerData = SimpleData.Load("PLAYER")
if playerData then
print(playerData.Cash)
print(playerData.Points)
else
return nil
end
“PLAYER” can be specified by adding player to the end of your PlayerAdded function, like this:
local SimpleData = require(SimpleDataLocation)
Players.PlayerAdded:Connect(function(player)
local playerData = SimpleData.Load(player)
if playerData then
print(playerData.Cash)
print(playerData.Points)
else
return nil
end
end)
Format for saving data:
local SimpleData = require(SimpleDataLocation)
SimpleData.Save("PLAYER", {Coins = 100, Points = 5})
You’ll need to specify the values being saved. (Again, “PLAYER” can be specified, however it needs to use Players.PlayerRemoving instead of Players.PlayerAdded)
Well, where do I get it??
It’s available now! What are you waiting for? Try it out!
Remember to submit any/all bugs to this post.