How do I disable an onKeyPress function when chat is open?
Hello ScriptingBuilders! Indeed, I require your assistance. :D
So, I have a script similar to this (taken from here:
1 | function onKeyPress(inputObject, gameProcessedEvent) |
2 | if inputObject.KeyCode = = Enum.KeyCode.R then |
7 | game:GetService( "UserInputService" ).InputBegan:connect(onKeyPress) |
And the script works all fine whenever I press a key (or in this case "R"), but it also works when typing in the chat and when pressing a key does something more visual (such as cloning a ScreenGUI), it can get pretty distracting and at a point, frustrating. Now, I haven't found anything about this on the forums, so I was wondering if anyone could help me out here. The help is always appreciated.
Thanks. :D
-IronSpider671