Script to hide text not working

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Make a script that allows you to type into a text box, while also hiding the text.
  2. What is the issue? Include screenshots / videos if possible!
    I wrote a script for it, but it keeps adding dots when you delete a character in the text box. Video:

Script:

script.Parent.Parent:GetPropertyChangedSignal("Text"):Connect(function()
	local strlngth = string.len(script.Parent.Parent.Text)
	for count=1,strlngth,1 do
		script.Parent.Text = script.Parent.Text .."•"
	end
	if strlngth == 0 then
		script.Parent.Text = ""
	end
end)

Explorer:
Screen Shot 2021-12-17 at 12.49.19 PM

Help is greatly appreciated!

Here you keep adding more dots every single time the text is changed.

Replace that entire thing with:

script.Parent.Text = string.rep("•", strlngth)
2 Likes

It works now, I didn’t realize it was that simple lol. Thanks!