For some reason, this text box I have does not recognize certain characters as actual characters, for example, question marks and slashes. When I do a printout of the number of characters, it says 0.
script.Parent.TextBox.FocusLost:Connect(function()
print("Focus lost")
print(#script.Parent.TextBox.Text)
if #script.Parent.TextBox.Text > 0 then
print("Text existing")
if cooldown == false then
--Cool stuff
end
end
end)
Pretty sure it won’t do that unless you split the characters/words up (whichever way you want to), since you’re looking for number of elements in a table/array with the # here.
script.Parent.TextBox.FocusLost:Connect(function()
local CharCount = string.split(script.Parent.TextBox.Text, "")
print("Focus lost")
print(#CharCount)
if #CharCount > 0 then
print("Text existing")
if cooldown == false then
--Cool stuff
end
end
end)
script.Parent.TextBox.FocusLost:Connect(function()
print("Focus lost")
print(string.len(script.Parent.TextBox.Text))
if string.len(script.Parent.TextBox.Text) > 0 then
print("Text existing")
if cooldown == false then
--Cool stuff
end
end
end)