const master_switch = UI.AddCheckbox("ZfixautowallZ");
const normal_killsays = ["leabl creator", "by leabl", "got easy for leabl", "leabl 1",
];
  
const hs_killsays = ["by leabl", "polkovnik leabl v store", "leabl creator",
];

const on_player_death = function()
{
    if(UI.GetValue.apply(null, master_switch))
    {
        const attacker = Entity.GetEntityFromUserID(Event.GetInt("attacker"));
        if(Entity.IsLocalPlayer(attacker) && attacker != Entity.GetEntityFromUserID(Event.GetInt("userid")))
        {
            Cheat.ExecuteCommand("say " + (Event.GetInt("headshot") == 1 && Math.random() > 0.5 ? hs_killsays[Math.floor(Math.random() * hs_killsays.length)] : normal_killsays[Math.floor(Math.random() * normal_killsays.length)]));
        }
    }
};

Cheat.Print("trashtalk js loaded, killsay count: " + normal_killsays.length + hs_killsays.length + "\n");
Cheat.RegisterCallback("player_death", "on_player_death");
