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 » Scripting Helpers
Home Search
 

Re: launching a function when a letter key is pressed?

Previous Thread :: Next Thread 
hugthefatman1 is not online. hugthefatman1
Joined: 06 Sep 2012
Total Posts: 1333
25 Mar 2014 11:29 AM
i know Button1Down, is there something for letter keys? like ButtonFpressed or something?
Report Abuse
roboslayer10 is not online. roboslayer10
Joined: 08 Aug 2011
Total Posts: 206
25 Mar 2014 11:35 AM
mouse:KeyDown:connect(function(keyname)
print(keyname)
if keyname == "r" then
print("RUN")
elseif keyname == " " then
print("Jump!")
elseif keyname == "0" then -- shift is represented as 0
print("Shift")
end
end
end)


but to avoid caps lock problems, use keyname = keyname:lower()
Report Abuse
YumERAGON is not online. YumERAGON
Joined: 18 Apr 2012
Total Posts: 3893
25 Mar 2014 12:06 PM
you can get mouse by using

mouse = player:GetMouse()

or by activating a tool

tool.Activated:connect(function(eventMouse)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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