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

Convery InputObject to Key Name?

Asked by 5 years ago

I know I can do

if key.KeyCode == Enum.KeyCode.A then
    --code A
end
if key.KeyCode == Enum.KeyCode.B then
    --code B
end
if key.KeyCode == Enum.KeyCode.C then
    --code C
end

--etc

but I don't want to check for every separate key. I want to return whatever key the player presses. This might be a stupid question, I just couldn't find the answer anywhere. Help?

0
InputObject.KeyCode.Name ScriptGuider 5640 — 5y
0
Thank you! I'm stupid. xP angeld23 5 — 5y

Answer this question