|
| 16 Oct 2016 09:41 PM |
Hey, I was just wondering what the best way to avoid key-based objects being pressed while chatting. For example if someone types a word with "F" in it then it will cause the flashlight to toggle.
|
|
|
| Report Abuse |
|
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
|
| 16 Oct 2016 09:59 PM |
huh, im actually curious how other games do it.
the only way i can think of is if the chat key is clicked '/' then remove the keybind, then when enter is clicked afterwards, readd the keybind.
its really inefficient though. id inspect other scripts tbh |
|
|
| Report Abuse |
|
|
Lykaon
|
  |
| Joined: 27 Oct 2014 |
| Total Posts: 784 |
|
|
| 16 Oct 2016 10:01 PM |
Might be due to other scripts interfering or someone just typed some REALLY BAD code that it screwed up to have that.
It honestly shouldn't do that. Ever.
|
|
|
| Report Abuse |
|
|
|
| 16 Oct 2016 10:02 PM |
Nope
UserInputService returns Game Processed Event as well after the input object
basically toggles between true or false whether or not the action is being performed on top or over a gui. |
|
|
| Report Abuse |
|
|
Aliics
|
  |
| Joined: 29 Sep 2014 |
| Total Posts: 471 |
|
|
| 16 Oct 2016 10:02 PM |
game:GetService('UserInputService').TextBoxFocused
and
game:GetService('UserInputService').TextBoxFocusRelease
also the parameters for both of these returns the name of the textbox in question, so you can check that too if you'd like.
|
|
|
| Report Abuse |
|
|
|
| 16 Oct 2016 10:03 PM |
| *InputBegan, InputEnded, and InputChanged in the UserInputService |
|
|
| Report Abuse |
|
|
Lykaon
|
  |
| Joined: 27 Oct 2014 |
| Total Posts: 784 |
|
|
| 16 Oct 2016 10:03 PM |
^ Never really had that happen. Oh well, thanks for info.
|
|
|
| Report Abuse |
|
|
Aliics
|
  |
| Joined: 29 Sep 2014 |
| Total Posts: 471 |
|
| |
|
|
| 17 Oct 2016 01:33 AM |
I ended up using Focused and FocusLost to disable/enable the localscripts responsible for the keys.
|
|
|
| Report Abuse |
|
|
|
| 17 Oct 2016 01:40 AM |
you can always just use user input service and check if the second argument is true or if it is false, it depends
when it is your desired outcome, it should either work only when you type into a textbox or only when youre not typing into a textbox |
|
|
| Report Abuse |
|
|
|
| 17 Oct 2016 06:20 AM |
Use a custom chat bar with focus and focus losted
|
|
|
| Report Abuse |
|
|