kings52
|
  |
| Joined: 22 May 2012 |
| Total Posts: 2011 |
|
|
| 29 Feb 2016 09:39 PM |
Hi,
I tried wiring keyboard keys A to a multi command to do something using BindAction, but while the command is running, the player cannot move in the direction that is controlled by A. I don't know what to do about this, so is there any way I could wire something to the WASD keys without affecting their movement in the actual game?
Thanks.
i have failed life. missed 10k | +10k+ OmegaGmaster 4 days left! |
|
|
| Report Abuse |
|
|
Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
|
| 29 Feb 2016 09:46 PM |
| Why not just use different keys? |
|
|
| Report Abuse |
|
|
kings52
|
  |
| Joined: 22 May 2012 |
| Total Posts: 2011 |
|
|
| 29 Feb 2016 09:49 PM |
@Zecha
The thing is the combination used actually spells out a secret word, and it has an "a" in it. That's why I'm trying to get it so when you press the proper combination of keys to spell the word then something happens.
Also, based on how I wrote the code, you have to press them in the EXACT order. Otherwise you will have to restart. So pressing A while playing in game wouldn't be "accidentally" activating the special command.
i have failed life. missed 10k | +10k+ OmegaGmaster 4 days left! |
|
|
| Report Abuse |
|
|
kings52
|
  |
| Joined: 22 May 2012 |
| Total Posts: 2011 |
|
|
| 29 Feb 2016 09:50 PM |
Also something similar happens while trying to bind the number keys to the function. They don't do anything and they won't bind successfully.
I tried binding the number keys to a function that prints "test" and it didn't do anything. The script was running, everything, and it still didn't work.
i have failed life. missed 10k | +10k+ OmegaGmaster 4 days left! |
|
|
| Report Abuse |
|
|
Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
|
| 29 Feb 2016 09:51 PM |
| Well then I'm not completely sure. I know if you remove a person's character, the WASD won't do anything, so you could have a GUI that temporarily freezes them lets say, then they can try to attempt to input the secret code, and if they don't know what it is, just exit out of the GUI, return their Walkspeed to normal and they continue. |
|
|
| Report Abuse |
|
|
|
| 29 Feb 2016 10:47 PM |
| Use UserInputService. It does not override the previous binds. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 29 Feb 2016 10:49 PM |
local uis = game:GetService("UserInputService")
uis.InputBegan:connect(function(input, event) if event then return end if input.KeyCode == Enum.KeyCode.E then print("Pressing E") end end)
|
|
|
| Report Abuse |
|
|
|
| 29 Feb 2016 10:52 PM |
@TimeTicks
Buddy, it needs to be easier.
local UIS = game:GetService("UserInputService") local Keys = Enum.KeyCode
UIS.InputBegan:connect(function(input) local Key = input.KeyCode if Key == Keys.E then print("Pressing E") end end)
w0t's the second parameter is for? |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 29 Feb 2016 10:53 PM |
To check if its anything other then pressing of the standard qwerty keys. Number values will call the event which then you would have to use.
|
|
|
| Report Abuse |
|
|
|
| 29 Feb 2016 10:56 PM |
| Wouldn't that be input.UserInputType ? |
|
|
| Report Abuse |
|
|