I need a menu to appear when a player presses the i key, which works. However, it also appears when the player is typing a chat message or is typing something in the console. I solved the issue when using the chatbox with:
self.InputEnabled = false
self.InputEnabled = true
And I tried this for the menu and console:
[lua]function GM:PlayerBindPress( ply, bind, pressed )
if ( string.find( bind, “toggleconsole” ) or string.find( bind, “cancelselect” ) ) then
print( “Menu or console opened!” )
But it seems PlayerBindPress isn’t called when those binds are used. Is there any other way to solve this?