User input service not working

The script is a local script and is in starter player scripts. Looked it up on google, tried restarting studio, tried reinstalling studio, nothing. Any help is greatly appreciated.

local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(input,gameProcessedEvent)
	if input.UserInputType == Enum.KeyCode.R then
		print("OKKKK")
	end
end)
local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(input,gameProcessedEvent)
	if input.KeyCode == Enum.KeyCode.R then -- .KeyCode as opposed to .UserInputType
		print("OKKKK")
	end
end)
1 Like

Ah thank you, I feel stupid now haha

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.