game:GetService('Players').PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) character:WaitForChild("Humanoid").Died:Connect(function() print("h") player.leaderstats.Deaths.Value = player.leaderstats.Deaths.Value + 1 end) end) end)
Put this script in ServerScriptService:
game:GetService("Players").PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(char) char:WaitForChild("Humanoid").Died:Connect(function() player.leaderstats.Deaths.Value = player.leaderstats.Deaths.Value + 1 end) end) end)
Hope it helps!