Advertisement
Guest User

Nouveau leaderstats

a guest
Nov 14th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.71 KB | None | 0 0
  1. game.Players.PlayerAdded:Connect(function(plr)
  2.     wait(10)
  3.     local Bill = game.ServerStorage.Rank:Clone()
  4.     Bill.Parent=plr.Character
  5.    
  6. end)
  7.  
  8. local DSS = game:GetService("DataStoreService")
  9.  
  10. local PlayerCash = DSS:GetDataStore("Money")
  11.  
  12. game.Players.PlayerAdded:Connect(function(Player)
  13.     Player.CharacterAdded:Connect(function(Character)
  14.        
  15.         local stats = Instance.new("Folder", Player)
  16.         stats.Name= "leaderstats"
  17.  
  18.         local Money = Instance.new("IntValue")
  19.         Money.Name = "Money"
  20.         Money.Parent = Player.leaderstats
  21.         Money.Value = PlayerCash:GetAsync(Player.UserId) or 0
  22.  
  23.         local Role = Instance.new("StringValue", stats)
  24.         Role.Name= "Rank"
  25.         Role.Value = "Member"
  26.  
  27.         game.Players.PlayerRemoving:connect(function(Player)
  28.             PlayerCash:SetAsync(Player.UserId, Money.Value)
  29.         end)
  30.     end)
  31. end)
  32. wait(10)
  33. for i,p in next,game.Players:GetChildren() do
  34. while wait(3) do
  35.     p.leaderstats.Money.Value = p.leaderstats.Money.Value +1
  36.    
  37.     wait(.1)
  38.     if p.leaderstats.Money.Value >= 5 and p.leaderstats.Money.Value <= 49 then
  39.        p.leaderstats.Rank.Value = "Vip"
  40.        
  41.     elseif p.leaderstats.Money.Value >= 50 and p.leaderstats.Money.Value <= 99 then
  42.        p.leaderstats.Rank.Value = "Vip+"
  43.        
  44.     elseif p.leaderstats.Money.Value >= 100 and p.leaderstats.Money.Value <= 999 then
  45.        p.leaderstats.Rank.Value = "Legend"
  46.        
  47.     elseif p.leaderstats.Money.Value >= 1000 and p.leaderstats.Money.Value <= 999999 then
  48.        p.leaderstats.Rank.Value = "Mythique"
  49.        
  50.     elseif p.leaderstats.Money.Value >= 1000000 then
  51.        p.leaderstats.Rank.Value = "Impossible"
  52.        end
  53. end
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement