|
| 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 |
|
|
|
| 01 Oct 2015 02:36 PM |
Keep track of wether or not they're chatting
i make u math.sqrt() |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 01 Oct 2015 03:49 PM |
What do you mean 2nd value??
The noobs shall be eradicated. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 01 Oct 2015 04:15 PM |
I don't understand ;( please help
The noobs shall be eradicated. |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2015 04:21 PM |
please??
The noobs shall be eradicated. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 01 Oct 2015 04:26 PM |
| Not use processed for the number keys. |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2015 04:26 PM |
So what do I do then....
The noobs shall be eradicated. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 01 Oct 2015 04:47 PM |
But I have to since I'm making an mmo :/
The noobs shall be eradicated. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|