Kat's leaderstats system

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

:sparkles: Features

  • Built with Object Oriented Programming
  • Simple, readable syntax
  • Automatic cleanup of internal connections
  • Custom event system (no Bindables needed)

:memo: 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)

:books: API Reference

:small_blue_diamond: Requiring the Module

local Module = require(Path.To.Module)

:small_blue_diamond: Creating a Leaderstats Object

local leaderstats = Module.Create(Player)
  • Player → expects a Player instance.
  • Creates a folder (leaderstats) attached to the player.

:small_blue_diamond: Creating a Stat

local Time = leaderstats:CreateValue("Name")
  • "Time"** → string name of the stat.
  • Returns a custom object with methods and events.

:small_blue_diamond: 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)

:small_blue_diamond: 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.

by “always increases”/“aways decreases”, does that also occur if you pass a negative? or does it just mean it’s always adding, or always subtracting the passed value?

Worded that a bit wrong, my apologies internalle what it does is value += or -=.