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

UserInputService+InputBegan trying to call a function when the I and O keys are pressed?

Asked by 9 years ago

Figured this problem out myself, nobody gave an answer so I can't deem this question as Answered.

I'm trying to make a pseudo camera and I need the I and O keys for those who can't remotely scroll with their mouse.

game:GetService("UserInputService").InputBegan:connect(function(input,gproc)
    if input.KeyCode==Enum.KeyCode.O then

    elseif input.KeyCode==Enum.KeyCode.I then

    end
end)
1
This looks right. Perci1 4988 — 9y
0
Nothing wrong with your code. Make sure it's in a localscript in somewhere that replicates to the client. Goulstem 8144 — 9y
0
It's in a LocalScript parented to StarterPlayerScripts xolbStudios 127 — 9y
0
Try adding print functions at lines 3 and 5 to see if the function works when you press "I" or "O" Validark 1580 — 9y

Answer this question