"Shoot in Range" Script

Hi. I’m currently developing a top-down shooter game and I am a N00B at Unity3D. I already have most of my game’s AI set up with the A* pathfinding plugin, but I need help designing a script that makes the bots “shoot” when they are within a certain range of the player and no walls are in front of them. Is this possible? I really need some help with this.
Thanks,

jSoftApps

use Vector3.Distance for player position transform poisition but i use recomended raycast for ai.

i used on this project raycast distance for enemy is close another action for far from player another action
back to position etc.

GameLink