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: User input service?

Previous Thread :: Next Thread 
EradicateTheNoobs is not online. EradicateTheNoobs
Joined: 03 Feb 2012
Total Posts: 1314
01 Oct 2015 02:35 PM
It activates the buttons when I'm chatting, how do I prevent this? This is what I'm doing

userInput = game:GetService("UserInputService")

userInput.InputBegan:connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard and input.UserInputState == Enum.UserInputState.Begin and input.KeyCode == Enum.KeyCode.One then
blahblahblaaah
end
end)


The noobs shall be eradicated.
Report Abuse
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
01 Oct 2015 02:36 PM
Keep track of wether or not they're chatting


i make u math.sqrt()
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
01 Oct 2015 02:37 PM
use the 2nd value returned from inputbegan

if not 2ndevent then

➳Lɪᴛᴀʟᴇʟᴀ ɪs ᴍʏ ɴᴀᴍᴇ, Lᴜᴀ ɪs ᴍʏ ɢᴀᴍᴇツ
Report Abuse
EradicateTheNoobs is not online. EradicateTheNoobs
Joined: 03 Feb 2012
Total Posts: 1314
01 Oct 2015 03:49 PM
What do you mean 2nd value??


The noobs shall be eradicated.
Report Abuse
foreverpower is not online. foreverpower
Joined: 05 Feb 2011
Total Posts: 5578
01 Oct 2015 04:00 PM
userInput = game:GetService("UserInputService")

userInput.InputBegan:connect(function(input, processed)
if processed then return end

if input.UserInputType == Enum.UserInputType.Keyboard and input.UserInputState == Enum.UserInputState.Begin and input.KeyCode == Enum.KeyCode.One then
blahblahblaaah
end
end)
Report Abuse
EradicateTheNoobs is not online. EradicateTheNoobs
Joined: 03 Feb 2012
Total Posts: 1314
01 Oct 2015 04:07 PM
@forever my function stopped working when I put that in so I did this

userInput.InputBegan:connect(function(input, processed)
if processed then print("testingbbb") return end

and it prints testingbbb even when I'm not chatting


The noobs shall be eradicated.
Report Abuse
EradicateTheNoobs is not online. EradicateTheNoobs
Joined: 03 Feb 2012
Total Posts: 1314
01 Oct 2015 04:15 PM
I don't understand ;( please help


The noobs shall be eradicated.
Report Abuse
EradicateTheNoobs is not online. EradicateTheNoobs
Joined: 03 Feb 2012
Total Posts: 1314
01 Oct 2015 04:21 PM
please??


The noobs shall be eradicated.
Report Abuse
EradicateTheNoobs is not online. EradicateTheNoobs
Joined: 03 Feb 2012
Total Posts: 1314
01 Oct 2015 04:24 PM
Ok so I just figured it out, it returns true when the player is chatting, but it still returns true when the player is not chatting when I click the number keys above the letters... What should I do, the number keys are the most important part of my game


The noobs shall be eradicated.
Report Abuse
foreverpower is not online. foreverpower
Joined: 05 Feb 2011
Total Posts: 5578
01 Oct 2015 04:26 PM
Not use processed for the number keys.
Report Abuse
EradicateTheNoobs is not online. EradicateTheNoobs
Joined: 03 Feb 2012
Total Posts: 1314
01 Oct 2015 04:26 PM
So what do I do then....


The noobs shall be eradicated.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
01 Oct 2015 04:40 PM
Not second value. Second parameter.

http://wiki.roblox.com/index.php?title=API:Class/UserInputService/InputBegan

You'll notice in the parameters there's a bool called gameProcessedEvent. Check if it's false then proceed with your function.
Report Abuse
EradicateTheNoobs is not online. EradicateTheNoobs
Joined: 03 Feb 2012
Total Posts: 1314
01 Oct 2015 04:43 PM
I have, but it returns the same value when pressing the numbers above the keys and when chatting so I don't know what to do now ;( heeeeeeeeeelp


The noobs shall be eradicated.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
01 Oct 2015 04:46 PM
Oh! Just noticed your keycode was One. Yeah, I have the same problem with number keys; apparently if you check for gpe == false in your code they don't work. So I don't suggest using number keys for anything particularly important
Report Abuse
EradicateTheNoobs is not online. EradicateTheNoobs
Joined: 03 Feb 2012
Total Posts: 1314
01 Oct 2015 04:47 PM
But I have to since I'm making an mmo :/


The noobs shall be eradicated.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
01 Oct 2015 04:49 PM
Then you'll have to deal with it because there's no way around it that I know of. Idk, try using Keydown. It's deprecated and you shouldn't use it but whatever floats your boat
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