Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

mouse.KeyDown doesn't work with numbers?

Asked by 7 years ago
Edited 7 years ago

Ok so my script is kinda like:

mouse.KeyDown:connect(function(key)
    print(""..key.." Down")
end)

mouse.KeyUp:connect(function(key)
    print(""..key.." Up")
end)

when i press 1, 2 and 3. It doesn't print when Key down but it does print when Key up. Anyone know why does this happen? Please respond soon, thanks!

1 answer

Log in to vote
1
Answered by
Link150 1355 Badge of Merit Moderation Voter
7 years ago

You made a typo on line #2.

Also, secondly, mouse.KeyDown is deprecated. It is recommended you use UserInputService instead. It works differently and might not seem as straightforward at first, but is actually pretty easy to use can make your game work on both PC, phones, tablets and Xbox.

0
In addition, with key down there will be keys ROBLOX used to utilize like i, o, and number keys. Though now, it does not appear the keys will be allowed in Keydown. Thus why they have deprecated it and released UIS. M39a9am3R 3210 — 7y
Ad

Answer this question