The hook HUDShouldDraw

I am currently trying to make the chat box disappear, the problem is when I click the chatbox key (Y for me) I can’t seem to open the console as well and then I have to reload the game

my code:

hook.Add( "HUDShouldDraw", "HideHUD", function( name )
	if ( name == "CHudChat" ) then
		return false

end )

The code is in cl_init.lua

Just cause it isn’t drawing doesn’t mean it isn’t there. You will also need to use the

GM:StartChat hook to prevent it from being opened.

Oh ok thanks!