Help with making players lose points when they die

I have been working on an Elo system for my game but I can’t figure out how to make the players lose points with out making the player that won lose points. I have already made the part where you win points, I just need them to lose points.

local EloUp = math.random(20, 40)

local EloDown = math.random(20, 41)

for i = GameLength,0,-1 do

	for x, player in pairs(plrs) do
		if player then
			
			character = player.Character
			
			if not character then
				--Left the server
				table.remove(plrs,x)
			else
				if character:FindFirstChild("GameTag")then
					--They are still alive
				else
					--they are dead
				table.remove(plrs,x)
					
				print(player.Name.." Is dead")
			plrs[1].leaderstats.Elo.Value = plrs[1].leaderstats.Elo.Value - EloDown

	if #plrs == 1 then
		-- last person left
		Status.Value = ""..plrs[1].Name.." has Won"
		wait(4)
		plrs[1].leaderstats.Cash.Value = plrs[1].leaderstats.Cash.Value + reward
		plrs[1].leaderstats.Wins.Value = plrs[1].leaderstats.Wins.Value + 1
		plrs[1].leaderstats.Elo.Value = plrs[1].leaderstats.Elo.Value + EloUp

I don’t know why but the if #plrs == 1 then is greyed out Its not in the actual code.

Why can’t you have a value for the winner, and use Humanoid.Died.

plr.Character.Humanoid.Died:Connect(function()
   if plr.leaderstats.InGame and not plr.leaderstats.Winner then
      --Subtract points
   end
end)

It didn’t work, It just said attempt to nil index ‘humanoid’