Advertisement
Anukun_Lucifer

leaderstats Script

May 28th, 2022
1,030
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. game.Players.PlayerAdded:Connect(function(Player)
  2.    
  3.     --leaderstats--
  4.    
  5.     local leaderstats = Instance.new("Folder",Player)
  6.     leaderstats.Name = "leaderstats"
  7.    
  8.     local level = Instance.new("NumberValue",leaderstats)
  9.     level.Name = "Level"
  10.     level.Value = 1
  11.    
  12.     local exp = Instance.new("NumberValue",leaderstats)
  13.     exp.Name = "Exp"
  14.     exp.Value = 0
  15.    
  16.     local requiredexp = Instance.new("NumberValue",Player)
  17.     requiredexp.Name = "RequiredExp"
  18.     requiredexp.Value = level.Value*100
  19.    
  20.     -- level up and Exp --
  21.    
  22.     exp.Changed:Connect(function(Changed)
  23.         if exp.Value >= requiredexp.Value then
  24.             exp.Value = 0
  25.            
  26.             level.Value += 1
  27.             requiredexp.Value = level.Value*100
  28.         end
  29.     end)
  30. end)
  31.  
Advertisement
RAW Paste Data Copied
Advertisement