Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I use Keyboard Inputting on a gui?

Asked by 8 years ago

I want to move the gui in the direction where I press. For example, W would be up. I know the code would look like this.

  1. function onKeyPress(inputObject, gameProcessedEvent)
  2. if inputObject.KeyCode == Enum.KeyCode.W then
  3. position.GUI X + 0.01
  4. end
  5. end
  6. game:GetService("UserInputService").InputBegan:connect(onKeyPress)

Please help. Thank you!

0
This isn't an answer, but to neaten up your code you can open up a code block by pressing the blue lua button (located on the taskbar above the text box and below the title) and inputting your script in between the ~'s that pop up! kelimeguy 60 — 8y
0
Thanks! lilsheeps 0 — 8y

Answer this question