Raphael7
|
  |
| Joined: 03 Dec 2008 |
| Total Posts: 2479 |
|
|
| 04 Nov 2011 05:30 PM |
Is there a way while holding the left mouse, and then press a button?
Here's my sample
Tool.Equipped:connect(function(mouse) mouse.Button1Down:connect(function() --Script mouse.KeyDown:connect(function(key) key=string.lower(key) if key=="q" then --Script end end) end) end) |
|
|
| Report Abuse |
|
|
aboy5643a
|
  |
| Joined: 20 Nov 2010 |
| Total Posts: 2785 |
|
|
| 04 Nov 2011 05:33 PM |
local clicked; Tool.Equipped:connect(function(mouse) mouse.Button1Down:connect(function() clicked = true end) mouse.Button1Up:connect(function() clicked = false end) mouse.KeyDown:connect(function(key) if clicked then if key == "q" then --Script end end end) end)
That'll do what you want. |
|
|
| Report Abuse |
|
|
Raphael7
|
  |
| Joined: 03 Dec 2008 |
| Total Posts: 2479 |
|
|
| 04 Nov 2011 06:14 PM |
| I meant like while you are holding the Button, and press a key. |
|
|
| Report Abuse |
|
|
GigsD4X
|
  |
| Joined: 06 Jun 2008 |
| Total Posts: 3794 |
|
|
| 04 Nov 2011 06:31 PM |
| ^ That's what aboy wrote. When the user clicks, it sets a variable to true and when he lets go it turns false—when a user presses a key it checks if the variable is true and executes the code if it is. |
|
|
| Report Abuse |
|
|