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: Can someone give me an example of Keyboard Inputs?

Previous Thread :: Next Thread 
The_Red is not online. The_Red
Joined: 23 May 2015
Total Posts: 1287
22 Jul 2016 12:41 AM
It would really help. Thanks.
Report Abuse
newcoolman2 is not online. newcoolman2
Joined: 01 Apr 2010
Total Posts: 2637
22 Jul 2016 12:43 AM
game:GetService"UserInputService".InputBegan:connect(function(key, gpe)
if key.KeyCode == Enum.KeyCode.Slash and not gpe then
--rip
end
end)

I'm using that for my custom chat ;3


Report Abuse
The_Red is not online. The_Red
Joined: 23 May 2015
Total Posts: 1287
22 Jul 2016 01:19 AM
How would I use the IsKeyDown?
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
22 Jul 2016 01:22 AM
http://wiki.roblox.com/index.php?title=API:Class/UserInputService/IsKeyDown


Add 13,000 posts
Report Abuse
SpeedySeat is online. SpeedySeat
Joined: 06 Jul 2011
Total Posts: 3048
22 Jul 2016 01:24 AM
I know you could check the Enum, but this way is a LOT more user friendly and readable in code.

UIS = game:GetService("UserInputService")

UIS.InputBegan:connect(K)
local key = K.KeyCode.Name
local UType = K.UserInputType.Name

if UType == "Keyboard" then
if key == "A" then
print'Pressed A!'
end
end

end)
Report Abuse
The_Red is not online. The_Red
Joined: 23 May 2015
Total Posts: 1287
22 Jul 2016 01:25 AM
@Nar

Yeah, that's really helpful.
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