Take this code for example:
game:GetService("UserInputService").InputBegan:connect(function(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.R then --Also, could be written as [[inputObject.KeyCode == "R"]]
print("R was pressed")
end
end)
From what I understand, every time a key is pressed, this function will fire and determine if the key pressed was R, and if it is, print that "R was pressed". My question being;
can the function only fire if the R key is pressed?
would it still be required that every input is listened to?
Does listening to every input not really matter in terms of lag?
