Death Leaderboard

ServerScriptService

--Leaderstats Setup

local function onPlayerJoin(player)
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player
 

    local deaths = Instance.new("IntValue")
    deaths.Name = "Deaths"
    deaths.Value = 0
    deaths.Parent = leaderstats
end
 
game.Players.PlayerAdded:Connect(onPlayerJoin)

--Death Tracker

game:GetService('Players').PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        character:WaitForChild("Humanoid").Died:Connect(function()
            player.leaderstats.Deaths.Value = player.leaderstats.Deaths.Value + 1
        end)
    end)
end)