Ezstatz, a basic Leaderstats module for beginner developers
Hello beginner developers! Have you been wanting to add a Leaderstats system to your game, but find it too complicated?
Well, i have something to show you!
Introducing Ezstatz!
With Ezstats, you’ll be able to create leaderboards at ease with just a few functions! The functions are, but are not limited to:
createLeaderstatsObject(player)
Creates a Leaderstats folder inside the player
parameter
createValue(player, name, valType)
Creates a value inside of the player
’s leaderstats folder with the provided valType
(Can be either an integer value or a string value)
Ezstatz comes with 5+ functions to help you with creating your leaderstats scripts!
If you wanna see more of the functions the module contains, or if you’d like to learn how to setup and use the module, you can view the documentation page for the module here.
Sample Script
Simple Leaderboard script with data saving functionality
local Ezstatz = require(workspace:WaitForChild("Ezstatz"))
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Ezstatz:createLeaderstatsObject(plr)
local cash = Ezstatz:createValue(plr, "Cash", "int")
local success, data = pcall(function()
return Ezstatz:getData(plr)
end)
if success then
if data then
Ezstatz:set(plr, "Cash", data.Cash)
else
Ezstatz:set(plr, "Cash", 15)
end
else
warn("Something went wrong:", data)
end
while task.wait(2) do
Ezstatz:incrementValue(plr, "Cash", 20)
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
local success, message = pcall(function()
Ezstatz:saveData(plr)
end)
if success then
print("Saved")
else
warn("Something went wrong:", message)
end
end)
Polls
- Yes
- Maybe
- No (Explain why in the replies)
0 voters
Links
And with all of that out of the way, I hope you guys find a use with the module, and happy scripting!
Positive feedback is optional but much appreciated.