Is it possible to make it so only letters are accepted

I am making this for my “Keybinding” system I have made, I am now stuck on how to make it only letters that can be entered.
If you could help that would be amazing!
Thank you, Zonix.

Can you please describe the problem more?

I have the binding working perfectly.
I am stuck on making it so only letters can be binded and not numbers/special characters.
Special Characters e.g. “[ , . ] ’ @ ; :” them

A good method for this would be to use string manipulation. Strings | Documentation - Roblox Creator Hub

I don’t have much time to test a working code example, but using the following example should return the string inputted with only letters.

local inputtedString = "STRING INPUTTED HERE"

inputtedString = string.match(inputtedString, "%a")

this should turn a string such as “HeLLo123%^$” into “HeLLo”. If you are wanting only one character to be inputted, a rather hacky solution you could implement would be to test if the string is returned as “”, or the returned string is different from the inputted one. for example if “h” is inputted “h” will be returned, but if “$” is inputted “” will be returned.

As I said I haven’t tested this code, but I think a similar solution should work well for the situation.

2 Likes

Thank you so much, this worked!
Also thank you to the other people that helped!

1 Like