📗
Ezstatz Documentation
  • 👋Welcome
  • ☑️Setting Up
  • 🪧Guide
    • 🥇Making Leaderboards via Ezstatz
    • 💾Managing Player Data
  • 🖥️API Reference
    • 📝Creator Functions
    • 🔄Getter Functions
    • ✅Setter Functions
    • ➕Comparison Functions
    • 💾Data Functions
  • ⚙️Settings Module
Powered by GitBook
On this page
  1. Guide

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.

PreviousGuideNextManaging Player Data

Last updated 1 year ago

🪧
🥇