Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

mouse.KeyDown doesn't work with numbers?

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

✓ Accepted answer

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.

1 comment

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.