local miscellaneous_functions = {
trashtalk = function(e)
if menu_database.handler.elements["Enable trashtalk"] then
local localplayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
if not localplayer then return end
local my_index = EntityList.GetClientEntity(EngineClient.GetLocalPlayer()):GetPlayer()
if not my_index then return end
if EngineClient.IsConnected() then
if e:GetName() ~= "player_death" then return end
local me = EntityList.GetLocalPlayer()
local victim = EntityList.GetPlayerForUserID(e:GetInt("userid"))
local attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"))
if victim == attacker or attacker ~= me then return end
local phrases = {
"1",
"2",
}
local get_phrase = phrases[Utils.RandomInt(1, #phrases)]:gsub('\"', '')
EngineClient.ExecuteClientCmd((' say "%s"'):format(get_phrase))
end
}