Well the title sums it up. I want to open a Menu on Tab Press, and close it when the user presses Tab again(And only that way!). And well it opens but it doesnt get called later anymore!
Here is my script:
if !key == IN_SCORE then return end
if TabMenu then
if TabMenu:IsVisible() then
And console output:
and thats it.
I cant do anything anymore. Does someone know how I could work around that?
Methinks it’s a problem with your CreateTabMenu. Post that code.
Ok Here it is:
TabMenu = vgui.Create("DFrame")
TabMenu:SetTitle("Menu. (Close by using TAB)")
Not much actually. I wanted first that the Toggle Works.
I think you’re going to have to use the input.IsKeyDown function in a think hook of the frame, since KeyPress is only called when you’re in game.
Ah ok. Well isnt there a much more efficient way?
Well I’d say you have a problem when you never set the size of the DFrame. Make sure you do that before you call Center(), otherwise it won’t work.
Yeah, as said I will do that once I managed to solve it. I think I will do it in an timer of 0.1 because think is a bit too often for that.