|
| 10 Feb 2017 08:19 PM |
What's the keycode of 1 on the keyboard?
|
|
|
| Report Abuse |
|
|
|
| 10 Feb 2017 08:23 PM |
just do
Enum.KeyCode.One and you should see the value in the auto-complete thing
|
|
|
| Report Abuse |
|
|
|
| 10 Feb 2017 08:26 PM |
InputBegan = coroutine.create(function(input) while true do print(input) if input.UserInputType == Enum.UserInputType.Keyboard then if input.KeyCode == Enum.KeyCode.One then --do stuff (its not doing stuff) end end coroutine.yield(InputBegan) end end)
function ConnectInputBegan(input) coroutine.resume(InputBegan, input) end UserInputService.InputBegan:connect(ConnectInputBegan)
Why does it print "InputObject" everytime. Also why it no work? :(
|
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Feb 2017 08:29 PM |
Because I want to add a timer to how long the player holds down a button, and I was going to make a variable keeping track of the state based on the InputBegan and InputEnded functions to set it to its appropriate state, but I also remembered that you can't execute 2 functions at once. Thats why I made it a coroutine
|
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 10 Feb 2017 10:11 PM |
"while true do"
NOOOOOOOO
filteringenabled or riot |
|
|
| Report Abuse |
|
|