local messages = {
"1",
}
local function random_message(tbl)
return tbl[math.random(1, #tbl)]
end
local function onEvent(event)
if event:get_name() == "player_death" then
local attacker = event:get_pawn_from_id("attacker")
if attacker and attacker == entities.get_local_pawn() then
game.engine:client_cmd('say ' .. random_message(messages))
end
end
end
mods.events:add_listener("player_death")
events.event:add(onEvent)