I want to make a script that when you get the message “You were killed by a Traitor” the word “Traitor” is red, or when “You were killed by a Detective” the word “Detective” is blue, or when “killed by prop/world” the words “prop/world” is grey. This is what I have.
function CustomTTTMsg(ply_or_rfilter, msg, clr)
clr = clr or Color(255, 255, 255, 255)
hook.Add(“DoPlayerDeath”, “MistRDMDet_NotifyDeaths”, function(ply, attacker, dmginfo)
if IsValid(attacker) and attacker:IsPlayer() then
if attacker == ply then
CustomTTTMsg(ply, “You killed yourself”, COLOR_GREEN)
local clr = attacker:GetRole() == ROLE_TRAITOR and COLOR_RED or COLOR_GREEN
CustomTTTMsg(ply, "You were killed by a " … attacker:GetRoleString(), clr)
CustomTTTMsg(ply, “You were killed by <something/world>”, COLOR_WHITE)
Could someone help me out?