Aisoc
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 412 |
|
|
| 18 May 2014 05:01 PM |
Player = script.Parent.Parent mouse = Player:GetMouse()
function onKeyDown(Key) -- i am not sure what is wrong i cant find it.. key = key:lower() if key == "r" then Instance.new("Part", Workspace) end end
if key:byte() == 32 then print("key byte is 32") end mouse.KeyDown:connect(onKeyDown)
Output
23:58:05.840 - Exception: Cannot attach debugger 23:58:19.412 - Players.Player1.Backpack.LocalScript:12: attempt to index global 'key' (a nil value) 23:58:19.413 - Stack Begin 23:58:19.413 - Script 'Players.Player1.Backpack.LocalScript', Line 12 23:58:19.414 - Stack End |
|
|
| Report Abuse |
|
|
Aisoc
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 412 |
|
| |
|
|
| 18 May 2014 05:11 PM |
| ONE PIECE SACRED DAWN 4 LYFE. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 18 May 2014 05:16 PM |
| change they "Key" to "key" in the function params |
|
|
| Report Abuse |
|
|
Aisoc
|
  |
| Joined: 08 Jun 2013 |
| Total Posts: 412 |
|
|
| 18 May 2014 05:27 PM |
local p = game.Players.LocalPlayer local m = p:GetMouse()
m.KeyDown:connect(function(Key) Key = Key:lower() if Key == "q" then print("") -- ok fixed it end end)
nvm |
|
|
| Report Abuse |
|
|