I want to know how (when you press a key on your keyboard) something can happen with Roblox LUA.
✓ ANSWER ACCEPTED
How can you use keys to make things happen?
1 answer
✓ Accepted answer
I'm here man!
You want to use UIS (UserInputService).
Try this:
local key = Enum.KeyCode.LeftShift --Change LeftShift with the key you want, for example, R.
function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == key then --code goes here down.
print("Left Shift was pressed.")
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
It works.
If you want a full list of key codes to use, here they go. Just copy the key you want from the left column, called "Name", behind "Enums", and have fun!
If this works, mark as correct, please, and as always, good scripting! ;)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Thanks again! (I also friended you in Roblox)
Yeah, I saw it. No problem! :D