Adding on to @Aerosphia, you may also want to consider using the ContextActionService | Documentation - Roblox Creator Hub. While it is a bit harder to figure out at first, players will likely find it very useful in preventing unwanted menus from opening while chatting!
As an example. (this isn’t tested, correct me if I’m wrong)
userInput.InputBegan:Connect(function(input,gameProcessed)
if gameProccessed then -- Prevents this from running when typing in chat
if input.KeyCode == Enum.KeyCode.Q then
end
end
end)