Hey Guys
Recently i make a datastore module that helps beginner, if they want to save their game data ( player coin, xp, etc ).
As you can tell from the title, this is “simplified” datastore module for beginner that include [ GetData, SetData, And more. ]
SetAsync() [ Save Data ]
[ Normal Roblox DataStoreService ] “:SetAsync()” Example:
local ds = game:GetService("DataStoreService")
local data = ds:GetDataStore("Test")
local s,r = pcall(function()
data:SetAsync(Player.UserId,300) -- Example Save 300 Coins
end)
if s then
print("Saved!")
end
[ My DataStoreService Module ] “:SetAsync()” Example:
local data = require(Path_To_Module.DataStoreModule)
data.DataName("Test")
data.Save(Player.UserId,300) -- Example Save 300 Coins
GetAsync() [ Load Data ]
[ Normal Roblox DataStoreService ] “:GetAsync()” Example:
local ds = game:GetService("DataStoreService")
local data = ds:GetDataStore("Test")
local s,r = pcall(function()
value = data:GetAsync(Player.UserId)
end)
if s then
print(value) -- Example The Output Value Is ( 300 )
end
[ My DataStoreService Module ] “:GetAsync()” Example:
local data = require(Path_To_Module.DataStoreModule)
data.DataName("Test")
data.Get(Player.UserId) -- Example The Output Value Is ( 300 )
As You Can See, If You Use The “Simplified” DataStore Module Can Get Your Work Done In Just A Few Lines Of Code
Hope This Can Help Any Beginner :
DataStoreModule.rbxm (3.1 KB)