Advertisement
yamanohera155233

Untitled

Jun 25th, 2016
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. local playerLeaderstats = {}
  2.  
  3. game.Players.PlayerAdded:connect(function(player)
  4. playerLeaderstats[player] = {}
  5. playerLeaderstats[player]["Money"] = 0
  6. local leaderstats = Instance.new("Model")
  7. leaderstats.Name = "leaderstats"
  8. leaderstats.Parent = player
  9. local money = Instance.new("IntValue")
  10. money.Name = "Money"
  11. money.Value = playerLeaderstats[player]["Money"]
  12. money.Parent = leaderstats
  13. end)
  14.  
  15. while wait(5) do
  16. for _, player in pairs(game.Players:GetPlayers()) do
  17. --We don't use the IntValue's value because an exploiter can modify it.
  18. playerLeaderstats[player]["Money"] = playerLeaderstats[player]["Money"] + 1
  19. if player:FindFirstChild("leaderstats") then
  20. player.leaderstats.Money.Value = playerLeaderstats[player]["Money"]
  21. end
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement