UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input, gameProccesedEvent) if input.Keycode == Enum.KeyCode.A then print("Player pressed the A key") end end)
The error: 15:26:01.142 Keycode is not a valid member of InputObject "InputObject" - Client - LocalScript:4 15:26:01.143 Stack Begin - Studio 15:26:01.145 Script 'Players.carrotboardgame.PlayerScripts.LocalScript', Line 4 - Studio - LocalScript:4
15:26:01.145 Stack End - Studio
UserInputService = game:GetService("UserInputService") UserInputService.InputBegan:Connect(function(input, gameProccesedEvent) if input.KeyCode == Enum.KeyCode.A then print("Player pressed the A key") end end)
As Shounak said, I changed it for you
The problem is that you said input.Keycode
instead of input.KeyCode
. What I'm saying is that the "c" should be upper case letter - C. If you fix that your script will be working fine