local hide_hud = false
-- https://wiki.facepunch.com/gmod/GM:PlayerBindPress
hook.Add("PlayerBindPress", "Test.PlayerBindPress", function(_, bind)
if (string.find(bind, "use")) then -- +use
hide_hud = !hide_hud
end
end)
hook.Add("HUDPaint", "Test.HUDPaint", function()
if (!hide_hud) then
surface.SetDrawColor(255,255,255,255)
surface.DrawRect((ScrW() - 64) * 0.5, (ScrH() - 64) * 0.5, 64, 64)
end
end)