|
| 11 Feb 2014 02:44 PM |
Right, so I tried to get input from a key using this:
sp = script.Parent activ = sp.Activ player = game.Players.LocalPlayer mouse = player:GetMouse() skillkey = sp.Parent.NumberVal -- An IntValue with the value "1"
mouse.KeyDown:connect(function(key) if key == skillkey.Value then print("Skill key " ..skillkey.Value.. " pressed") activ = true end end)
I looked at this wiki page for reference: http://wiki.roblox.com/index.php/Taking_keyboard_input I get no errors, the print statement doesn't get printed... It just doesn't work. What am I doing wrong here? |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2014 02:55 PM |
| Sorry for bumping so fast, but I'm in a bit of a hurry. Thanks. |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
| |
|
| |
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 11 Feb 2014 03:01 PM |
| You cannot use the number keys as they're "reserved" for the backpack. |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2014 03:03 PM |
| Are they still reserved if I disable the CoreGui? |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
| |
|
solvar
|
  |
| Joined: 22 May 2011 |
| Total Posts: 149 |
|
|
| 11 Feb 2014 03:06 PM |
| Yea I was wondering same thing if you disabled the inventory would u be able to use them? |
|
|
| Report Abuse |
|
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 11 Feb 2014 03:07 PM |
"Are they still reserved if I disable the CoreGui?" No. Also, change the IntValue to a StringValue. Currently you'd be comparing a string with a number. |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2014 03:08 PM |
| If you remove the backpack coregui, or the backpack itself, the keys are free. |
|
|
| Report Abuse |
|
|
|
| 11 Feb 2014 03:12 PM |
| Alright, thanks a lot for your time DataStore. Works perfectly now ^^ |
|
|
| Report Abuse |
|
|