Created
December 29, 2024 21:19
-
-
Save bubu07codes/9448ac795424b91318c3f21a88eabb36 to your computer and use it in GitHub Desktop.
Simple leaderstats template by BubuTheDev
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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