This is a Cash, KO, WO leaderboard
-- Start leaderboard
game.Players.PlayerAdded:connect(function(player)
-- Make leaderstats
local leaderstats = Instance.new("IntValue", player)
leaderstats.Name = "leaderstats"
local money = Instance.new("IntValue", leaderstats)
money.Name = "Cash"
money.Value = 100
local deaths = Instance.new("IntValue", leaderstats)
deaths.Name = "Deaths"
deaths.Value = 0
local kills = Instance.new("IntValue", leaderstats)
kills.Name = "Kills"
kills.Value = 0
-- Do stuff
while true do
money.Value = money.Value + 1
wait(1)
end
player.Character:WaitForChild("Humanoid").Died:connect(function()
deaths.Value = deaths.Value + 1
end)
end)

7 comments
It still does not work, the moeny was fine the deaths wern't working.
That what this fixes. The functions that manages the deaths never connects because the loop is initiated before it. Move the loop to BELOW that function.
It didn't work.
It also stops the Money from +1
I recommend using a coroutine.
Are you putting the loop inside of the Humanoid.Died function, or below? It has to be below it, inside of the final end)
I put it isnide the final end), also I don't know how to script a coroutine I've been wanting to knwo what it is.