
aom_playerapi.damage = {}

core.register_on_dieplayer(function(player, reason)
    player:get_meta():set_string("dead", "true")
end)
core.register_on_respawnplayer(function(player)
    player:get_meta():set_string("dead", "")
end)

core.register_globalstep(function(dtime)
    for i, player in ipairs(core.get_connected_players()) do
        local meta = player:get_meta()
        if player:get_hp() > 0 then
            meta:set_string("dead", "")
        end
    end
end)
