Text to symbol converter

Hello!
I am currently working on creating a database type system in-game. I am looking for an effect in which after each character is typed in the password box it converts to a dot/bulletpoint however I’m not sure how to do this while also storing the value of the password to be used when authenticating the login credentials. Any ideas?

You could try converting every string in there to a • so for example you say hello it converts it to ••••• , I am unsure why you need this, as this is a LocalGUI and no one else can look.

This is purely a cosmetic feature to aid user experience, I will have a go at your suggestion. Many thanks!

1 Like

For this you can utilise the string.rep function, this will repeat something a certain amount of time.

print("hi", 5) --prints five hi next to each other
--prints hihihihihi

So what we can do is, repeat the dots according to the number of the characters in the string, and to get the number of chars in a string, or simply its length. You can use the # operator along with the string, or you can use the string.lenwhich returns the length of the given string.

local password = "hi8766kl" --suppose this is our password

textbox.Text = string.rep("•", string.len(password)) 
--and yeah perfect 

--we can as well do this
textbox.Text = string.rep("•", #password) 
--just a side note you can only use the # if its stored in a  variable, you can't do #"hi8766kl" store it in a variable and use they key of the variable instead #password
3 Likes

This may not be directly on topic, but can’t you just wrap the string in parentheses if you want to use the # operator? I remember using parentheses to use :sub() on a string when I was lazy and testing something.

--Not on PC to test now

local strVar = "This is a string"
print(#strVar)

print(#("This is a string"))

Oh I actually didnt know you can do this, thanks for the info!

2 Likes

Got another correction for you chief.

This is not correct. You actually can do this.

print(#"Yes") -- 3
1 Like

Oh woah, there is a really a lot of small details I shall remember, because I did recall myself testing this out and getting it wrong welp my memory failed me

Thank you!

1 Like