Question about C

Hello guys, well its a quick question, i’ve a frame that is being opened by a command… i would like if someone can help me to know how i can add that to C like when you hold C open the tab and when you un-hold it close the tab huh idk if is difficult…

Thanks guys :slight_smile:

hook.Add( “PlayerButtonDown”, “name”, function( ply, button )
if button == KEY_C then
RunConsoleCommand( “TheCommand” )
end
end)

hook.Add( “PlayerButtonUp”, “name2”, function( ply, button )
if button == KEY_C then
RunConsoleCommand( “TheCloseCommand” )
end
end)

This is pretty basic, but you can build on it

whats the point of ply in there? you should be using ply:ConCommand() not RunConsoleCommand

Works but the unique problem is that its like mmm showing / hiding like hell haha :stuck_out_tongue: any way to make it only one thing a time ?

Use these hooks instead:

In case the player has context menu bound to another key.