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: How would i..

Previous Thread :: Next Thread 
Moolah101 is not online. Moolah101
Joined: 22 Sep 2010
Total Posts: 614
07 Jul 2012 04:54 PM
Make a keydown event?
Report Abuse
Biostream is not online. Biostream
Joined: 28 Mar 2011
Total Posts: 913
07 Jul 2012 04:55 PM
Use mouse.

In a hopperbin:

script.Parent.Selected:connect(function(m)
m.KeyDown:connect(function(k)
if(k == "k") then
print("K was pressed.")
end
end)
end)
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
07 Jul 2012 04:56 PM
script.Parent.Selected:connect(function(m)
m.KeyDown:connect(function(key)
key:lower()
if(k == "l") then
print("l was pressed.")
end
end)
end)
Report Abuse
Moolah101 is not online. Moolah101
Joined: 22 Sep 2010
Total Posts: 614
07 Jul 2012 05:04 PM
@ninja, i get mostly of tat script, but what button do we have to press?
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
07 Jul 2012 05:06 PM
an eye
"I"
captial I but lower case
Report Abuse
Moolah101 is not online. Moolah101
Joined: 22 Sep 2010
Total Posts: 614
07 Jul 2012 05:10 PM
Kk, but wha about this script:

function onKeyDown(key)
if string.lower(key) == "a" then
print("The a key was pressed!")
else
print("The "..string.lower(key).." key was pressed!")
end end

script.Parent.Selected:connect(function (mouse)
mouse.KeyDown:connect(function () onKeyDown(mouse) end)
end)

I get the first lines but the big space, from down, i dont get it, the three lines...
Report Abuse
Moolah101 is not online. Moolah101
Joined: 22 Sep 2010
Total Posts: 614
07 Jul 2012 05:11 PM
I get everything but this line:

if(k == "l") then

Why is there a k there!? what does it do...
Report Abuse
Moolah101 is not online. Moolah101
Joined: 22 Sep 2010
Total Posts: 614
07 Jul 2012 05:12 PM
Forget the post i posted after urs..., but DONT FORGET THE POST TWO AFTER URS...
Report Abuse
ninjaknight101 is not online. ninjaknight101
Joined: 04 Apr 2011
Total Posts: 1281
07 Jul 2012 05:13 PM
Oops, I copy pasted :P it should be key
Report Abuse
Moolah101 is not online. Moolah101
Joined: 22 Sep 2010
Total Posts: 614
07 Jul 2012 05:14 PM
So the k, is supposed to be key?
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