When a player write some text as a Substring it means its only a part of the whole string.
So you need to start it when a player types "-attack" and then you need to calculate what the player said AFTER the -attack.
the conditions of substrings you see do that.
For example the red one condition - (Substring((Entered chat string), 9, 11)) Equal to red - it checks that at the 9th character of the whole string there is a "r", then at the 10th there is a "e" and at the 11th there is a "d".
I made it 9-11 since "-attack" is 1-7, so the whole string would be "-attack red" and would include 11 characters (yes space is a charcater).
If you need more explaination I would be glad to explain.