|
| 04 Apr 2013 01:52 PM |
I am wondering what the parameters for using this are. I got this straight from the wiki:
game.Players.LocalPlayer:GetMouse().Button2Down:connect(function() print("Button2 down!") end)
And it works,but this one that I made:
game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(k) print(k) end)
does not. Can I use the KeyDown event or not? |
|
|
| Report Abuse |
|
|
| |
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 04 Apr 2013 02:30 PM |
game.Players.LocalPlayer:GetMouse():connect(function(k) k.KeyDown:connect(function(key) print(key) end) end) |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2013 03:01 PM |
| KeyDown is an event of the mouse. |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Apr 2013 06:15 PM |
| In Play Solo mode? Do all the buttons you press work? |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2013 06:17 PM |
Your's should work.
(╯°□°)> KMXD |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2013 08:41 PM |
| I definitely doesn't. What is wrong? |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Apr 2013 09:51 PM |
| In the object browser description of the Button2Down event in Mouse, it says "This event is currently non-operational." I don't know how current that is though. |
|
|
| Report Abuse |
|
|
|
| 04 Apr 2013 10:18 PM |
| That one works. KeyDown does not. |
|
|
| Report Abuse |
|
|
OKevinO
|
  |
| Joined: 05 May 2010 |
| Total Posts: 1036 |
|
|
| 04 Apr 2013 11:02 PM |
Try this:
mouse = Game.Players.LocalPlayer:GetMouse()
mouse.KeyDown:connect(function(key) if key == "F" then ("CODE") end)
|
|
|
| Report Abuse |
|
|
|
| 07 Apr 2013 06:27 PM |
| still nothing (and I did put in the 'end'). |
|
|
| Report Abuse |
|
|
OKevinO
|
  |
| Joined: 05 May 2010 |
| Total Posts: 1036 |
|
|
| 08 Apr 2013 11:26 AM |
| try to put it in a ScreenGui, i put mine in that and it works, never tried putting it in workspace but it might work. |
|
|
| Report Abuse |
|
|
|
| 08 Apr 2013 11:31 AM |
| It wont work in Workspace. GetMouse requires it to be inside a local script, and local scripts only run from within a players Backpack, ScreenGui or Character. |
|
|
| Report Abuse |
|
|
|
| 08 Apr 2013 09:34 PM |
| I originally put it in a LocalScript in the StarterGui. |
|
|
| Report Abuse |
|
|