I have a custom chatbar and I have an if statement, but I don't know exactly what code I need for it.
I've tried just about every page of the wiki and nothing.
For example:
1 | if (chat doesnt have just '' or ' ' ) then |
2 | --do stuff |
3 | else |
4 | (run code) |
5 | end |
You would check the Text property of the TextBox or TextLabel, example;
1 | local TextBox = --Define this. |
2 | if TextBox.Text = = "" then |
3 | elseif TextBox.Text ~ = "" then |
4 | end |
If this helps, please accept my answer, it gives us both rep!
The text property is used to determine what text is in a TextBox or TextLabel.
Your question is asking if you can determine if there's any text in a TextBox. Here's how you'd do it:
1 | local textBox = --define textBox here |
2 |
3 | if textBox.Text ~ = "" then --this checks to see if the TextBox's text is not blank, i.e. if there's any letters in it |
4 | --run code |
5 | end |