generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: KeyPress firing when chatting

Previous Thread :: Next Thread 
ShadyBlue is not online. ShadyBlue
Joined: 10 Apr 2013
Total Posts: 2939
09 Dec 2016 08:16 AM
How do I make it so listeners for keypresses don't fire when you're chatting? Thanks!


Report Abuse
nooneisback is not online. nooneisback
Joined: 28 Feb 2012
Total Posts: 1672
09 Dec 2016 09:05 AM
There is a second argumen which ContextActionService returns which is called game processed. If it's true then the player isn't typing something or using the menu.
Report Abuse
Jaidenati is online. Jaidenati
Joined: 10 Oct 2012
Total Posts: 192
09 Dec 2016 10:01 AM
GetFocusedTextbox if you're using UserInputService, what it does is basically return the textbox currently selected. So if you do an if GetFocusedTextbox == nil then it will prevent it for ANY textbox. I haven't heard of the one that the guy above me said, so I don't know if it is more efficient than this, regardless, this works.
Report Abuse
RogueMage is not online. RogueMage
Joined: 28 Jan 2012
Total Posts: 1235
09 Dec 2016 10:04 AM
Use UserInputService and do this

uis = game:GetService("UserInputService")

uis.InputBegan:Connect(function(input, event)
if not event then -- Make sure they're not chatting
~~~~~~~~~
end
end)
Report Abuse
ShadyBlue is not online. ShadyBlue
Joined: 10 Apr 2013
Total Posts: 2939
09 Dec 2016 10:53 AM
Thanks guys, I'll try all of those and see which one works best.


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
09 Dec 2016 12:34 PM
@rogue

save a line and indentation with

if event then return end

ty

why people do that gross way is beyond me


Report Abuse
ShadyBlue is not online. ShadyBlue
Joined: 10 Apr 2013
Total Posts: 2939
10 Dec 2016 10:08 AM
^Good point, parsimony is a value.
Report Abuse
Rerumu is not online. Rerumu
Joined: 11 Oct 2014
Total Posts: 950
10 Dec 2016 10:50 AM
if reasonToLive return nil end

The thread forever went on.
Report Abuse
Rerumu is not online. Rerumu
Joined: 11 Oct 2014
Total Posts: 950
10 Dec 2016 10:51 AM
Or not because I forgot a then.
Report Abuse
ShadyBlue is not online. ShadyBlue
Joined: 10 Apr 2013
Total Posts: 2939
10 Dec 2016 12:28 PM
^lol


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image