I don’t have the time to piece together everything which is happening now, but you should open blender in a console, or look at the console output when you’re writing python scripts. For example, on line 34, where you say “town.turretcontrol…”. Delete the “town.” and just have it “turretcontrol.whateveritisyoudohere”.
A useful hint is that you can access a property’s value by saying “own.prop”. So own.prop = 3, if own.prop >= 4 , that kinda stuff. It’ll save you messing with those sensors and actuators you’re using to deal with the booleans.
Also, you don’t have an object called “hitobj”. I’m assuming you want to automatically input the name of the object which the collision sensor detects. For this a “touch” sensor might be better, only because I can see it in the api. sensor.getHitObjectList().
Here’s the api (also available in my sig under GE).
Good luck with this!