TTT Death Notifier Not Working.

Every time a person dies to fall damage or gets hit by a car they are still “ALIVE”. They can talk to people that are alive.

if ( SERVER ) then

hook.Add( "PlayerDeath", "CHIIPPPSS" , function( Pl, Ent, Killer )

umsg.Start( "PlayerDeathCustom", Pl )
umsg.Entity( Killer )
umsg.Bool( Killer:IsTraitor() )
umsg.Bool( Killer:IsDetective() )
umsg.End()

end)


else

usermessage.Hook( "PlayerDeathCustom" , function( um )

local Killer = um:ReadEntity()
local IsT = um:ReadBool()
local IsD = um:ReadBool()

chat.AddText( Color( 255,255,255 ) , "You've been killed by ", Color( 175,175,175 ), Killer:Nick(),
Color( 255,255,255 ), ( ( IsT or IsD ) and ", a " or ", an " ), ( (IsT and Color( 255,99,99)) or (IsD and Color( 52,128, 209)) or Color(161,232,116) ),
( (IsT and "Traitor!") or (IsD and "Detective!") or "Innocent!" ) )

chat.PlaySound()

end)

end

If you have a solution to this please reply to this.

Don’t worry about it anymore I got it figured out.

It’d be nice if you showed the community how it was fixed.

I don’t get why everyone uses usermessages and net on TTT death logs, it’s not necessary and uses data that could be used else where (Like in the game mode).

How would you propose it be done?

[lua]
function TTTDeath(ply, attacker, dmginfo)
if IsValid(attacker) and attacker:IsPlayer() then
if attacker:IsTraitor() then
ply:ChatPrint(“You were killed by “…attacker:Nick()…” who is a traitor.”)
end
end
end
hook.Add(“DoPlayerDeath”, “TTTDeaths”, TTTDeath)
[/lua]
ran shared

-SNIIIIIIIIP-

Why all this work when you could have just done what this guy did?