Don't do what you did:
PHP Code:
if (statement) if (otherstatement) {
}
Either do:
PHP Code:
if (statement) {
if (otherstatement) {
}
}
or even (I prefer using two ifs though):
PHP Code:
if (statement && otherstatement) {
}
The above two are much more readable and will be easier to modify in the future. When you modify the code.
Also:
PHP Code:
function ChatBar.onAction() {
if (ChatBar.text.trim() == "/flagadder") {
OpenGui(); //Opens the GUI.
ChatBar.text = ""; // Clear the chatbar so /flagadder isn't chatted out loud.
}
}