LUA HELP: Binding Menu To Key

Okay so I know the function to use is input.IsKeyDown but what I need help with is achieving the effect the spawn menu has but with mine. Where you have to hold the key down and when you let go the menu closes.

Put it in a draw or think hook

[lua]hook.Add(“Draw”, “checkforkey”, function()
if( input.IsKeyDown(numberhere) )then
– draw, if not then dont draw.
end
end)[/lua]

Use this if you want to bind it to the whatever button the player has the spawn menu binded to (usually q)

[lua]function GM:OnSpawnMenuOpen( )[/lua]
and

[lua]function GM:OnSpawnMenuClose( )[/lua]

Edit:
If you need anymore help just ask me
And no your gamemode doesn’t need to be derived from sandbox for this to work(Felt like people might say that)

Are you talking about using the q key, replacing the spawnmenu? > ChoclatePancake’s method

Or having the same effect, whereas you press key <INSERT KEY> and your menu opens? > My post