function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.R then print("R was pressed") end end

game:GetService("UserInputService").InputBegan:connect(onKeyPress)

GameProccessedEvent and InputObject are not defined how then can you put InputObject.Keycode with defining the inputObject!

1 comment

0

Please format your code with the Lua button!