In my game I want to add the keybind CTRL + ` to open a gui. But backquote also opens the backpack. So I want backquote to not open the backpack when CTRL is being held. I have tried
local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")
ContextActionService:BindActionAtPriority(
"Toggle",
function(_, inputState, _)
if inputState == Enum.UserInputState.Begin and UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) then
-- my logic is here
return Enum.ContextActionResult.Sink
end
return Enum.ContextActionResult.Pass
end,
false,
9999,
Enum.KeyCode.Backquote
)
My logic works but backpack still keeps opening. I know some of you will suggest disabling the backpack but backpack is a critical part of my game so I can’t disable it. And before you ask, no I can’t change the keybind it is supposed to be the same as Visual Studio Code’s terminal toggle keybind.