im2awsm
|
  |
| Joined: 25 Aug 2010 |
| Total Posts: 2295 |
|
|
| 28 Apr 2015 07:22 AM |
| the wiki doesn't explain it very well. what's inputObject and gameProcessedEvent supposed to represent? And after copying that exact script into a tool's onEquipped section, I found out that when you press R even without the tool equipped, it still prints "R was pressed". Any way around this? |
|
|
| Report Abuse |
|
|
im2awsm
|
  |
| Joined: 25 Aug 2010 |
| Total Posts: 2295 |
|
|
| 28 Apr 2015 07:23 AM |
| oh and this was the wiki page I was referring to, sorry I forgot it http://wiki.roblox.com/index.php?title=Keyboard_input |
|
|
| Report Abuse |
|
|
|
| 28 Apr 2015 07:46 AM |
Just use InputBegan.
game:GetService("UserInputService").InputBegan:connect(function(inputObject, Bool) if not Bool and (Check if tool is equipped [debounces]) then -- If player isn't typing if inputObject.KeyCode == Enum.KeyCode.R then -- Do stuff end end end) |
|
|
| Report Abuse |
|
|
iiEssence
|
  |
| Joined: 18 Jun 2014 |
| Total Posts: 3467 |
|
|
| 28 Apr 2015 08:02 AM |
Your inputobject is basically your keyboard or whatever the user is typing with.
Not sure about gameProcessedEvent |
|
|
| Report Abuse |
|
|