mouse.KeyDown:connect(function(key)
print(key:byte())
if key:byte() == 49 and currentslot.Name == "Slot1" then
print("1")
usepotion()
elseif key:byte() == 50 and currentslot.Name == "Slot2" then
print("2")
usepotion()
elseif key:byte() == 51 and currentslot.Name == "Slot3" then
print("3")
usepotion()
elseif key:byte() == 52 and currentslot.Name == "Slot4" then
print("4")
usepotion()
elseif key:byte() == 53 and currentslot.Name == "Slot5" then
print("5")
usepotion()
elseif key:byte() == 54 and currentslot.Name == "Slot6" then
print("6")
usepotion()
elseif key:byte() == 55 and currentslot.Name == "Slot7" then
print("7")
usepotion()
elseif key:byte() == 56 and currentslot.Name == "Slot8" then
print("8")
usepotion()
end
end)
http://wiki.roblox.com/index.php?title=Taking_keyboard_input http://wiki.roblox.com/index.php?title=File:Ascii_Table.png
The first print I have prints the key.byte, and it works when I press a letter, but not a number. The tabled where I got the numbers from shows both letters and numbers, but the wiki doesn't mention it. Help? How could I solve this?
[Edit 2] Fixed, for bound keys that roblox doesn't want you to use (ex: i and o for camera), use keyup.

1 comment
Nah, but thanks for the help!