XxxLloyd061302xxX

Leaderboard Script

Jun 11th, 2018
4,505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.42 KB | None | 0 0
  1. -- We also gonna put an anti-cheat for the credits/wins :3
  2.  
  3. game.Players.PlayerAdded:connect(function(player)
  4.     game.Workspace.Players.Value = game.Workspace.Players.Value + 1
  5.     local folder1 = Instance.new("Folder")
  6.     folder1.Parent = player
  7.     folder1.Name = "leaderstats"
  8.     local folder2 = Instance.new("Folder")
  9.     folder2.Parent = player
  10.     folder2.Name = "Settings"
  11.     local currency = Instance.new("IntValue",folder1)
  12.     currency.Name = "Credits" -- Put your currency name here. Mine is Credits
  13.     local wins = Instance.new("IntValue",folder1)
  14.     wins.Name = "Wins"
  15.     local realcurrency = Instance.new("IntValue",folder2)
  16.     realcurrency.Name = "RCurrency"
  17.     local realwins = Instance.new("IntValue",folder2)
  18.     realwins.Name = "RWins"
  19.     local afk = Instance.new("BoolValue",folder2)
  20.     afk.Name = "AFK"
  21.     local winner = Instance.new("BoolValue",folder2)
  22.     winner.Name = "Winner"
  23.     local playing = Instance.new("BoolValue",folder2)
  24.     playing.Name = "Playing"
  25.    
  26.     player.CharacterAdded:connect(function(char)
  27.         char.Humanoid.Died:connect(function()
  28.             -- We are gonna reset the Winner and Playing to false so they will be disqualified on that minigame
  29.             winner.Value = false
  30.             playing.Value = false
  31.         end)
  32.     end)
  33.    
  34.     while wait() do
  35.         wins.Value = (realwins.Value/10)
  36.         currency.Value = (realcurrency.Value/10)
  37.     end
  38. end)
  39.  
  40. game.Players.PlayerRemoving:connect(function()
  41.     game.Workspace.Players.Value = game.Workspace.Players.Value - 1
  42. end)
Advertisement
Add Comment
Please, Sign In to add comment