Kat’s leaderstats system
A module for creating and managing leaderstats with clean OOP syntax
Made by K0_zzy on 21/08/2025
You can get it here: Link to model
Uses GoodSignal
Features
Built with Object Oriented ProgrammingSimple, readable syntaxAutomatic cleanup of internal connectionsCustom event system (no Bindables needed)
Sample Usage
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Leaderstats = require(ReplicatedStorage.Leaderstats)
Players.PlayerAdded:Connect(function(Player)
local leaderstats = Leaderstats.Create(Player)
local Time = leaderstats:CreateValue("Time")
Time.Changed:Connect(function(NewValue)
print(`Time changed to {NewValue}`)
end)
while task.wait(1) do
Time:IncrementValue(1)
end
end)
API Reference
Requiring the Module
local Module = require(Path.To.Module)
Creating a Leaderstats Object
local leaderstats = Module.Create(Player)
Player→ expects aPlayerinstance.- Creates a folder (
leaderstats) attached to the player.
Creating a Stat
local Time = leaderstats:CreateValue("Name")
"Time"** → string name of the stat.- Returns a custom object with methods and events.
Methods
Time:GetValue()
Returns the current value (number)
Time:SetValue(-100)
SetValue is absolute: directly overwrite the value. (can be positive or negative)
Time:ResetValue()
Resets the value to 0
Time:IncrementValue(1)
Adds to the current value (always increases)
Time:DecrementValue(1)
Subtracts from the current value (always decreases)
Events
Time.Changed:Connect(function(NewValue)
-- returns the new value
end)
Fires whenever the stat’s value changes. Passes the new value as an argument.