When I use the brackets with the Enum.Userinput, it keeps showing error < is not a valid member of “Enum.KeyCode”
My script here is:
local user = game:GetService('UserInputService')
user.InputBegan:Connect(function(key, the)
for i,v in ipairs(script.Parent.Text:split("")) do
print(string.upper(v))
print(Enum.KeyCode[string.upper(v)])
if key.KeyCode == Enum.KeyCode[string.upper(v)] then
script.Parent.Text = '<b>'..i..'</b>'
end
end
end)
My error:
< is not a valid member of “Enum.KeyCode”
The reason you get that error is because the actual key “<”, is not registered as that symbol in the keycode API,
All of the keycodes go off specific names. Having something like Enum.KeyCode.< would not be logical as well, it would think that your trying to use the less than symbol.