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
 

Is there any way to use BindAction on WASD?

Previous Thread :: Next Thread 
kings52 is not online. 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 is not online. Zechariax
Joined: 22 Mar 2012
Total Posts: 206
29 Feb 2016 09:46 PM
Why not just use different keys?
Report Abuse
kings52 is not online. 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 is not online. 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 is not online. 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
izzatnasruna is not online. izzatnasruna
Joined: 09 Jun 2009
Total Posts: 1927
29 Feb 2016 10:47 PM
Use UserInputService. It does not override the previous binds.
Report Abuse
TimeTicks is not online. 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
izzatnasruna is not online. izzatnasruna
Joined: 09 Jun 2009
Total Posts: 1927
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 is not online. 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
izzatnasruna is not online. izzatnasruna
Joined: 09 Jun 2009
Total Posts: 1927
29 Feb 2016 10:56 PM
Wouldn't that be input.UserInputType ?
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