Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local playerLeaderstats = {}
- game.Players.PlayerAdded:connect(function(player)
- playerLeaderstats[player] = {}
- playerLeaderstats[player]["Money"] = 0
- local leaderstats = Instance.new("Model")
- leaderstats.Name = "leaderstats"
- leaderstats.Parent = player
- local money = Instance.new("IntValue")
- money.Name = "Money"
- money.Value = playerLeaderstats[player]["Money"]
- money.Parent = leaderstats
- end)
- while wait(5) do
- for _, player in pairs(game.Players:GetPlayers()) do
- --We don't use the IntValue's value because an exploiter can modify it.
- playerLeaderstats[player]["Money"] = playerLeaderstats[player]["Money"] + 1
- if player:FindFirstChild("leaderstats") then
- player.leaderstats.Money.Value = playerLeaderstats[player]["Money"]
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement