Moolah60
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 654 |
|
|
| 18 Nov 2012 03:38 PM |
Alright so I know the Byte Codes for the arrow Keys (17 = up) (18 = down) but when I use them in a Hopper Bin or with the :GetMouse() function they do not work, even when I test with print(). Is it because Roblox is overriding it since they control camera and player movement or is it something I'm doing wrong?
Example Script:
tool = script.Parent
function printKey(key) if key == string.byte(17) then print("Up was pressed!") end
function selected(mouse) mouse.KeyDown:connect(printKey) end
tool.Selected:connect(selected) |
|
|
| Report Abuse |
|
|
ferm
|
  |
| Joined: 24 Feb 2009 |
| Total Posts: 22 |
|
|
| 18 Nov 2012 03:40 PM |
tool = script.Parent
function printKey(key) key = string.byte(key) if key == 17 then print("Up was pressed!") end
function selected(mouse) mouse.KeyDown:connect(printKey) end
tool.Selected:connect(selected) |
|
|
| Report Abuse |
|
|
Moolah60
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 654 |
|
|
| 18 Nov 2012 03:41 PM |
| Oh I see I'll try that then |
|
|
| Report Abuse |
|
|
|
| 18 Nov 2012 04:25 PM |
tool = script.Parent
function printKey(key) key = string.byte(key) if key == 17 then print("Up was pressed!") end end
function selected(mouse) mouse.KeyDown:connect(printKey) end
tool.Selected:connect(selected)
---------------
Ya'll forgot an 'end'. |
|
|
| Report Abuse |
|
|