*Help* Hud drawing images.

Hi all I have an element on my hud. But I only want it to appear when you the player has killed another player. Here is my code atm I hope someone can provide me with a small solution to this issue.

draw.RoundedBox( 4, 1700, 500, 220, 170, Color( 144,200,149,255 ) )
		surface.SetDrawColor(225, 225, 225 )
		surface.DrawTexturedRect(1710, 520, ScrW()/13, ScrH()/8 )

I thought I could perhaps hook it to make it appear using something like this, but I wasn’t sure how to go about it.

hook.Add("PlayerDeath", "sex", function(victim, inf, attack) if ( inf and inf:GetClass() == "infnigun" and attack and attack:IsValid() and attack:IsPlayer()

Any help is greatly appreciated.



draw functions cannot be called outside HUDPaint and anything alike.

PlayerDeath gets called once, while HUDPaint etc. get called each frame, in other words: you have to use HUDPaint.