NextPrintTime = 0 playerhit = "false" function HUDPaint() if playerhit=="true" then draw.RoundedBox(0, ((ScrW() - 2) / 2)-1, ((ScrH() - 20) / 2), 2, 20, Color(255,0,0,255) ) draw.RoundedBox(0, ((ScrW() - 20) / 2)-1, ((ScrH() - 2) / 2), 20, 2, Color(255,0,0,255) ) else draw.RoundedBox(0, ((ScrW() - 2) / 2)-1, ((ScrH() - 20) / 2), 2, 20, Color(0,0,255,255) ) draw.RoundedBox(0, ((ScrW() - 20) / 2)-1, ((ScrH() - 2) / 2), 20, 2, Color(0,0,255,255) ) end end function HitDetect() ## Function Start ## trace = util.GetPlayerTrace(Player) if (trace.Entity:IsPlayer()) then ## IF ## if (CurTime() >= NextPrintTime) then ## IF## GAMEMODE:AddNotify(trace.Entity:Team(), NOTIFY_GENERIC, 2 ) GAMEMODE:AddNotify(trace.Entity:Name(), NOTIFY_GENERIC, 2 ) NextPrintTime = CurTime() + 5 playerhit = "true" else playerhit = "false" end end hook.Add( "HUDPaint", "TestPaint", HUDPaint ) hook.Add( "Think", "HitDetect", HitDetect )