🥇Making Leaderboards via Ezstatz
Setting up a Leaderstats script using Ezstatz is quite easy as you think it is. To get started, locate where you have placed the Ezstatz module, create a new script and write something like the script below.
local Ezstatz = require(game.ServerScriptService:WaitForChild("Ezstatz"))Once you're done, go ahead and connect a PlayerAdded event from the Players service.
After that, call the Ezstatz:createLeaderstatsObject() to start creating the leaderstats.
local Ezstatz = require(game.ServerScriptService:WaitForChild("Ezstatz"))
game.Players.PlayerAdded:Connect(function(player) -- Runs each time a user joins
local leaderstats = Ezstatz:createLeaderstatsObject(player)
end)Next, we will make our first stats value. We will call it Gems. The code below will make such value.
local Ezstatz = require(game.ServerScriptService:WaitForChild("Ezstatz"))
game.Players.PlayerAdded:Connect(function(player) -- Runs each time a user joins
local leaderstats = Ezstatz:createLeaderstatsObject(player)
local gems = Ezstatz:createValue(player, "Gems", "int")
end)If there is no leaderstats folder, the createValue() function will have a likely chance to error. Make sure you're calling the createLeaderstatsObject() function before calling the createValue() function.
Last updated