for i,v in pairs(game.Players:GetPlayers()) do
x = Instance.new("IntValue",v)
x.name= "leaderstats" -- not sure this is right
y = Instance.new("IntValue",x)
y.Name = "Gold"
v.CharacterAdded:connect(function(what) what.Died:connect(function(that)
game.Players:GetPlayerFromCharacter(that).leaderstats.Gold.Value = 0
end) end)
end
game.Players.PlayerAdded:connect(function(v)
x = Instance.new("IntValue",v)
x.name= "leaderstats" -- not sure this is right
y = Instance.new("IntValue",x)
y.Name = "Gold"
v.CharacterAdded:connect(function(what) what.Died:connect(function(that)
game.Players:GetPlayerFromCharacter(that).leaderstats.Gold.Value = 0
end) end)
end)
while wait(5) do
for i,v in pairs(game.Players:GetPlayers()) do
v.leaderstats.Gold.Value = v.leaderstats.Gold.Value + 10
end
end
Sorry, use this ^^ |