I have a variable called 'currentLetter' which is used earlier on in my code to get the first letter of string. I also have a textbox which I want to detect whether or not the letter I have typed is in the variable. I have done this with userInputService and using InputBegan but it doesn't seem to be working.
game:GetService("UserInputService").InputBegan:connect(function(inputObject, gameProcessedEvent)
if inputObject.KeyCode == currentLetter then
print("Hello")
end
end)
Any help would be very much appreciated. Thanks

2 comments
Keycode's are meant to be used as Enumerators. Any old string value will never work. Aditionally no point in adding gameproccesedevent argument if you aren't using it.
Could you please post where the currentLetter variable is defined?