✓ Accepted answer
KeyDown is deprecated and will no longer work, we now have to use userinputservice.
(Userinputservice is client only!)
local UserInputService = game:GetService('UserInputService')
function onInputBegan(input,gameProcessed)
if input.KeyCode == Enum.KeyCode.Up then
end
end
UserInputService.InputBegan:connect(onInputBegan)
You can see I use Enum for the keycode, you can find the keycodes here
But these are the ones you need
Enum.KeyCode.Up
Enum.KeyCode.Down
Enum.KeyCode.Left
Enum.KeyCode.Right
To do the normal stuff (letters) you can simply do this
Enum.KeyCode.A
Enum.KeyCode.B
Enum.KeyCode.C
There are more things you can do with it, but these are the things you need.
If you have a question, just ask :)
2 comments
Perfect, exactly what I was looking for thank you! The link to the other KeyCodes was also very useful, much appreciated! :)
Np :)