Untested, but this should work.
if SERVER then
util.AddNetworkString("WhoKilled")
hook.Add("PlayerDeath", "WhoKilled", function( victim, weapon, killer )
net.Start("WhoKilled")
net.WriteString( (killer:IsPlayer() and killer:Nick() or "the world") )
net.WriteInt( (killer:IsPlayer() and killer:GetRole() or -1), 8 )
net.Send( victim )
end)
else
net.Receive("WhoKilled", function()
local killer = net.ReadString()
local killer_role = net.ReadInt(8)
local str = "You were killed by "..killer.."!"
if killer_role == ROLE_INNOCENT then
chat.AddText( Color(0,255,0), str )
elseif killer_role == ROLE_TRAITOR then
chat.AddText( Color(255,0,0), str )
elseif killer_role == ROLE_DETECTIVE then
chat.AddText( Color(0,0,255), str )
else
chat.AddText( Color(255,255,0), str )
end
end)
end