|
| 12 Oct 2013 06:48 PM |
| This is my KeyDown script. If you press "Shift" it prints ("hi"). It won't work. Please help. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
lupine
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 3561 |
|
|
| 12 Oct 2013 06:51 PM |
The shift key doesn't have an alphabetical character attatched to it, so you'd do something like
mouse.KeyDown:connect(function(key) if key:byte() == 47 or 48 then -- 47 is left shift, 48 is right shift |
|
|
| Report Abuse |
|
|
| |
|
lupine
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 3561 |
|
|
| 12 Oct 2013 06:53 PM |
| 48 is left, 47 is right shift* |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2013 06:58 PM |
function KeyDownFunctions(key) if key == "0" then print 'true' end end
function KeyUpFunctions(key) if key == "0" then print 'false' end end
I need this one to be fixed. It doesn't work if i press shift. There is no output. |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2013 07:00 PM |
| Are you sure Lupine? When I used the byte printing both shifts returned as the same numbers. Might this be the case for certain keyboards? I use a logitech board |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2013 07:02 PM |
... For... Different... Keyboards... *facedesk* |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2013 07:03 PM |
function KeyDownFunctions(key) if key:byte() == 47 or 48 then print 'true' end end function KeyUpFunctions(key) if key:byte() == 47 or 48 then print 'false' end end |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2013 07:05 PM |
| Doesn't work. I chose 48. I pressed left shift. |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Oct 2013 07:29 PM |
function KeyDownFunctions(key) if key == "0" then print 'true' end end function KeyUpFunctions(key) if key == "0" then print 'false' end end
function Equip(Mouse) wait() if Mouse == nil then print("Mouse not found") return end mouse.KeyDown:connect(KeyDownFunctions) mouse.KeyUp:connect(KeyUpFunctions) end
script.Parent.Selected:connect (Equip)
I tried to fix it. This is what I got. Still doesn't work. |
|
|
| Report Abuse |
|
|
| |
|