generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How exactly does UserInputService work?

Previous Thread :: Next Thread 
im2awsm is not online. 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 is not online. 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
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image