Having a strange problem which I can’t seem to find a way to fix. When I press F7, UserInputService KeyCode detects it as pressing C, and F8 is detected as B. I’ve tried checking for the InputObject.KeyCode.Value and InputObject.KeyCode.
The code below should only print when you hit C but it prints if you hit F7 as well.
local UserInputService = game:GetService(“UserInputService”)
UserInputService.InputBegan:Connect(function(Input)
if Input.KeyCode.Value == 99 then
print("C has been pressed")
end
end)
local UserInputService = game:GetService(“UserInputService”)
UserInputService.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.C then
print("C has been pressed")
end
end)
Also, just tiny note, on my laptop F2 detect as C for some reason.
The only other reasonable answer I can think of for why it’s not working correctly is if your keyboard settings match the one of the language you speak (English in this case.) If it does, then I would troubleshoot my keyboard, but that’s all I can think of.