ok im making a game like min-town defense now i have the guys spawn and then they attack to a location on the other side of the town with the town hall. when the town hall is destroyed u lose. but they bypass the town i wnat them to destroy teh town before they go afer teh town hall how can i do this?

ADDITION:
bump*
They're considering the town as a unworthy building. Like a supply depot next to a bunker, they'll go for bunker.
You could always set the Order command to Patrol, that will make them attack along the way. Even if there is a bunker and supply depot, they would kill the bunker then get the supply depot, not just completely skip it. Unless there was a line of bunkers for whatever reason.
Another possible problem is that you have made the town for a neutral player. No matter what, the computers will never attack a neutral unit. Otherwise, the town hall and the enemies could be allies. If thats not it, and your sure you set the attack command(not the move command), then i have no idea what to do... GL with your problem.
ok i have it as attack and theren ot nuetral and they are bot henemies andt hey only stop to attack when they get atacked im gona try fwop_s method
ADDITION:
it works thx fwop_

im guessing that you already figured it out, but another way is to run ai script:random suicide missions?
If you want them to not attack the town hall until the rest of the town is destroyed, have the town hall owned by an allied or neutral player, and then have it given to an enemy once the town is dead.
And yes, use Order Patrol to command the units. Random/Strategic Suicide Missions would be much less efficient, creating problems such as if you preserve it for units in the path they are constantly changing targets, and if you only give them the command at the beginning they often make runs for the buildings instead of the units attacking them if the units attacking them were spawned later.
well the chaneg targets thing isnt a problem because theres the location they get created at and then the the town halls one so when they at the start one they are orderd to patrol to tow nhall os it only does it once per unit.