So, I'm creating a script, and I've found a bug that I don't understand.

This is where it's bugging:

function Filter(txt)
	txt=txt:gsub("[PLRNAME]",plr.Name:upper())
	print(txt)
	for i = 1, #txt do
		ChatLabel.Text=txt:sub(1,i)
		wait(.05)
	end
end

Filter("Testing. [PLRNAME]")

ChatLabel is a TextLabel, and plr is the LocalPlayer the text is turned into "SUPERSONICFAN111" about 7 times, with a [ and ] surrounding the 7 ones I need help with this, so if anyone can help me, that'd be great