I made this max characters local script for the textbox, but it won't work. The character counter works, but it doesn't prevent the text from exceeded 42 characters.
Here's the script:
script.Parent:GetPropertyChangedSignal("Text"):Connect(function() local txt = script.Parent.Text local chars = string.len(txt) script.Parent.Parent.MaxCharacter.Text = chars.." / 42" --Shows the current characters of the text. if chars < 42 then txt = txt:sub(1,42) end end)
If someone could help me, that would be greatly appreciated.
script.Parent:GetPropertyChangedSignal("Text"):Connect(function() local txt = script.Parent.Text local chars = string.len(txt) script.Parent.Parent.MaxCharacter.Text = chars.." / 42" --Shows the current characters of the text. if chars < 42 then --That's the less than sign should be ">". txt = txt:sub(1,42) end end)
wow i am bad