Advertisement
SourceYT

New Leaderstats Script

Jul 13th, 2020
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1. game.Players.PlayerAdded:Connect(function(Player)
  2.     local leaderstats = Instance.new("Folder") -- Don't Change
  3.     leaderstats.Name = "leaderstats" -- Don't Change
  4.     leaderstats.Parent = Player -- Don't Change
  5.    
  6.     local Value = Instance.new("IntValue") -- I want to save this value after leaving the game
  7.     Value.Name = "Points"
  8.     Value.Parent = leaderstats
  9.     Value.Value = 0
  10.    
  11.     local Value2 = Instance.new("IntValue") -- I don't want to save this value after leaving the game
  12.     Value2.Name = "RN"
  13.     Value2.Parent = leaderstats
  14.    
  15.     local Value3 = Instance.new("StringValue") -- I don't want to save this value after leaving the game
  16.     Value3.Name = "Rank"
  17.     Value3.Parent = leaderstats
  18.     Value3.Value = "Owner"
  19.    
  20.     -- To create a new value, just copy and paste this text and change the components to your liking
  21.     local MyValue = Instance.new("StringValue") -- Change MyValue to what you want to name your value or just keep it idrc, change StringValue to what type of value you would like to store
  22.     MyValue.Name = "Value" -- Change "Value" to the name of your value
  23.     MyValue.Parent = leaderstats
  24.     MyValue.Value = 1 -- Change the number to the starting value or to the only value
  25.     -- Delete the MyValue if you want to
  26.    
  27. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement