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: KeyDown isn't working on Equipped.

Previous Thread :: Next Thread 
thelolguy301 is not online. thelolguy301
Joined: 27 Sep 2011
Total Posts: 2997
13 May 2014 01:00 PM
function KeyDown(key)
key = key:lower()
if key == "x" then
print("Key pressed")
end
end


function Equipped()
mouse.KeyDown:connect(function(KeyDown) end)
end

Tool.Equipped:connect(Equipped)

Nothing happens when I do this? What's wrong with it?
Report Abuse
Joe11Joe99 is not online. Joe11Joe99
Joined: 22 May 2011
Total Posts: 34458
13 May 2014 01:02 PM
if its a hopperbin try .Selected:connect
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
13 May 2014 01:07 PM
You didn't define mouse
Report Abuse
thelolguy301 is not online. thelolguy301
Joined: 27 Sep 2011
Total Posts: 2997
13 May 2014 02:43 PM
I did in the actual script. Also, Tool is also defined. It's more about the line below function Equipped()
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
13 May 2014 02:45 PM
tool.Activated:connect(function()

end)

This will fire when the player presses on the mouse if the tool is equipped.
Look it up if you don't believe me.
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
13 May 2014 02:45 PM
Lol sorry I just read the thread I was looking at the replies.
Report Abuse
thelolguy301 is not online. thelolguy301
Joined: 27 Sep 2011
Total Posts: 2997
13 May 2014 03:23 PM
Not a single reply has helped me so far. Bump.
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
13 May 2014 03:26 PM
The event is called KeyDown and the function is called KeyDown, that's not good.
Report Abuse
AetherShotgun is not online. AetherShotgun
Joined: 17 Mar 2014
Total Posts: 656
13 May 2014 03:28 PM
You are doing this...

function(ARGUMENT = KeyDown) end)

You should be doing (function(KeyPressed) Keydown(KeyPressed) end)
Report Abuse
thelolguy301 is not online. thelolguy301
Joined: 27 Sep 2011
Total Posts: 2997
14 May 2014 12:41 AM
Kk I'll try that.
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
14 May 2014 03:38 AM
I think I got the same problem here.
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