Menu should not open when

Hello i have created a menu that opens everytime when a player press LShift + R but it opens also when i am chatting or when i am typing something in the Console. Does anybody know how i can abvoid it from opening the menu when im typing in the chat and typing something in the console?

It won’t be doing that randomly, there will be something in your code making it do that. Can you share your code?

local f3delay = 0
hook.Add("Think", "ShiftRPressCheck", function() -- loop funktion
    if input.IsKeyDown(KEY_LSHIFT) and input.IsKeyDown(KEY_R) and f3delay < CurTime() then
        f3delay = CurTime() + 1 -- 1 sekunde delay zwischen nochmal erfasse
        if ( frame ) then
        if ( gui.EnableScreenClicker ) then
            gui.EnableScreenClicker( false )

function OpenShiftRMenu()
    --menu code

Here is the code

input.IsKeyDown will only return one key at a time. But you can “bypass” this by using a KeyPress or PlayerButtonDown hook and input.IsKeyDown to do this.

Oh yeah, its probably when you are holding shift to put a capital r then. Like @Florian4016 said use the PlayerButtonDown hook as that wont be called when a panel has keyboard input such as the chatbox or console.

Yeah thx that helped me with my Menu. But i also running a hook which calls if a Player Press a Specifig button like when the Player is Pressing Shift + V then RunConsoleCommand(“ulx” “cloak”)

How do i do it then?

Cant you just do the same thing you did with the menu? Just use the PlayerButtonDown hook again.

Ok butit won’t work for me :frowning:

Whats the code your using?

Nevermind i got it thx for the Help

1 Like

Do you know how i can close this Post?

I don’t think you can except the moderators.