top of page
Search

Open Source Leaderstats Script

  • Writer: Asporus
    Asporus
  • Aug 9, 2020
  • 1 min read

Leaderstats are very simple, and most developers that have developed for at least a week have learned them. Some new people, though, might wanna learn. Leaderstats are practically the things you see on a leaderboard. Not your name, stuff such as "Kills", "Deaths", "Coins", "Cash", etc.


This is a tutorial on how to do it where it doesnt go on the leaderboard, but still stores your stats into the player. (No datastore.)



local Player = game.Players.LocalPlayer
local Stat1 = Instance.new("NumberValue",Player)
local Stat2 = Instance.new("NumerValue",Player)

Stat1.Value = 0
Stat2.Value = 0

Stat1.Name = "Stat1"
Stat2.Name = "Stat2"

Very simple instancing. If you wanted to define these stats in another script, simply do this:


local Player = game.Players.LocalPlayer
local Stat1 = Player:WaitForChild("Stat1")
local Stat2 = Player:WaitForChild("Stat2")

If you would like these stats to be in a folder inside of the player, simply do the same script at the very top just like this


local Player = game.Players.LocalPlayer
local StatFolder = Instance.new("Folder",Player)
local Stat1 = Instance.new("NumberValue",StatFolder)
local Stat2 = Instance.new("NumerValue",StatFolder)

Stat1.Value = 0
Stat2.Value = 0

Stat1.Name = "Stat1"
Stat2.Name = "Stat2"

 
 
 

Recent Posts

See All
Open Source Run System

This is a running system using the service known as "UserInputService". UserInputService, (abbreviated as UIS), practically detects input...

 
 
 
Open Source Camera Manipulation GUI

For this script, you will need a part named "CamPart" or you can change the variable to your desired part in workspace. Make sure the...

 
 
 

Comments


Post: Blog2_Post
  • Facebook
  • Twitter
  • LinkedIn

©2020 by Asporus. Open Source Script Library.

bottom of page