Garfanzo
|
  |
| Joined: 24 Apr 2015 |
| Total Posts: 742 |
|
|
| 18 Jan 2016 05:14 PM |
| I have looked into UserImputService, but I cannot figure out how to use it... Could I get a basic script of how to use it? |
|
|
| Report Abuse |
|
|
Ryuzoji
|
  |
| Joined: 21 Dec 2015 |
| Total Posts: 937 |
|
| |
|
Garfanzo
|
  |
| Joined: 24 Apr 2015 |
| Total Posts: 742 |
|
|
| 18 Jan 2016 05:18 PM |
| Thanks man, I have all I need now. |
|
|
| Report Abuse |
|
|
|
| 18 Jan 2016 05:23 PM |
I looked into it in the wiki, and so far I have this, but I haven't figured out how to get keys pressed from it yet, but I'll keep testing and let you know if I come up with anything.
local userinput = game:GetService("UserInputService")
userinput.InputBegan:connect(function(x,x2) print(x,x2) end)
|
|
|
| Report Abuse |
|
|
|
| 18 Jan 2016 05:31 PM |
Alright, I played around a little more, but I had inconsistent results with what I was trying to accomplish. You can play around with it if you'd like though, I need to get back to what I was originally working on. Thanks for helping me earlier, hoped I could be of any help to you. This is inside of a regular script inside of Workspace:
local userinput = game:GetService("UserInputService")
if userinput.KeyboardEnabled == false then return else print("Keyboard is enabled.") end
userinput.InputChanged:connect(function(x,x2) print(x,x2) if userinput:IsKeyDown(101) then print("E was pressed!") end end)
|
|
|
| Report Abuse |
|
|
|
| 18 Jan 2016 06:00 PM |
game:service'UserInputService'.InputBegan:connect(function(input,gpe) if gpe or input.UserInputType~=Enum.UserInputType.Keyboard then return end if input.KeyCode==Enum.KeyCode.E then print'e was pressed' end end) |
|
|
| Report Abuse |
|
|
Garfanzo
|
  |
| Joined: 24 Apr 2015 |
| Total Posts: 742 |
|
| |
|