Skip to content

Instantly share code, notes, and snippets.

@bubu07codes
Created December 29, 2024 21:19
Show Gist options
  • Save bubu07codes/9448ac795424b91318c3f21a88eabb36 to your computer and use it in GitHub Desktop.
Save bubu07codes/9448ac795424b91318c3f21a88eabb36 to your computer and use it in GitHub Desktop.
Simple leaderstats template by BubuTheDev
-- Simple leaderstats template by BubuTheDev
-- Creates a folder called "leaderstats" (needs to be exact, dont change!)
-- Creates a value called Points with a starting value of 0
-- Every second Points will get increased by 1
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats" -- Change the name to "Leaderstats" if you want to make the leaderboard invisible
leaderstats.Parent = player
local points = Instance.new("IntValue") -- Value Type (IntValue,NumberValue,StringValue,Color3Value...)
points.Name = "Points" -- Name of the leaderstat
points.Parent = leaderstats
points.Value = 0 -- Starting value
-- Adds 1 Point every second
task.spawn(function()
while task.wait(1) do
points.Value += 1
end
end)
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment