Ais such as this are better to be do done via classic trigger editor.
Make funcions like this
Normal state -> Go to the enemy base and try to steal the flag Have a flag -> Run home directly Teamamte has the flag -> protect him Your flag is stolen -> follow flaggcarrier . . .
You must imagine all possible situations and script them, it is not hard