flams2000
|
  |
| Joined: 29 Apr 2009 |
| Total Posts: 188 |
|
|
| 07 Apr 2014 07:14 PM |
I'm trying to insert a InputObject into game.Workspace so I can view the properties and how I can use it. I've used the wiki but there isn't much help to how I can insert this.
The goal is to be able to read when the player presses 'e' it runs a script by using the InputObject to read the keys being pressed. Any and all other alternatives will be helpful
Wiki article: http://wiki.roblox.com/index.php?title=RBX.lua.InputObject_(Object)
Script: function p() i = Instance.new("InputObject") i.Parent = game.Workspace end
I don't get any errors from this but "InputObject" isn't inserted |
|
|
| Report Abuse |
|
|
|
| 07 Apr 2014 07:16 PM |
You're doing it wrong
game:GetService'UserInputService'
Input object is just a placeholder. |
|
|
| Report Abuse |
|
|
flams2000
|
  |
| Joined: 29 Apr 2009 |
| Total Posts: 188 |
|
|
| 07 Apr 2014 07:18 PM |
| Will I have to use localscripts to use this? |
|
|
| Report Abuse |
|
|
| |
|
flams2000
|
  |
| Joined: 29 Apr 2009 |
| Total Posts: 188 |
|
|
| 07 Apr 2014 07:20 PM |
| could you give an example of reading a key off of the UserInputService? |
|
|
| Report Abuse |
|
|
|
| 07 Apr 2014 07:43 PM |
userInput = game:GetService("UserInputService")
userInput.InputBegan:connect(function(input) if input.UserInputType == Enum.UserInputType.Keyboard and input.UserInputState == Enum.UserInputState.Begin and input.KeyCode == Enum.KeyCode.Tab then print("tab placed") end end) |
|
|
| Report Abuse |
|
|
flams2000
|
  |
| Joined: 29 Apr 2009 |
| Total Posts: 188 |
|
| |
|
Ariophy
|
  |
| Joined: 08 Mar 2014 |
| Total Posts: 81 |
|
| |
|