Getting the AI to walk to the nearest Capture Zone Which isn't its own

So I have a game where I need the AI to slowly stat taking over zones. I had it go to random location and if the zone it was in was not theirs it would wait there and if it was, it would go away…
I wanted to make it smarter by making it go to the closest zone which isn’t theirs (their team’s) and wait there until captured.

What it does is when it turns on it gets the AI_bot Parent, then gets an array of the zones and starts a loop

which goes through each array and checks, who OWNS that Zone. If the Bot’s team matches the Zone’s Team it ends there.
However, if it doesn’t match (= it passes) it goes to check the distance between the Bot AT the zones and saves the “index/locator” of the nearest zone.

Then it gets the “XY” Location of that zone and makes the AI go to it.

Yet what happens is the AI just stands there. And even after capturing the zone it doesn’t move. If I make it chase me, when it looses the sight of me, it goes back to that spawning point…

What am I doing wrong? When Printing, the zone does show as “true”, but the “zone_locator_final” DOESN’T change. It looks like it’s not getting the information about the current location of the AI_Bot…

Ok, alot of coding for me. But have you put all zones in an array, the captured zones in an array, compared the both and go from there?

If you compare theses arrays, you would be able to find which zone has not and choose a random zone to go from there.

Just a thought, some one will come up with better.

Regards