Advanced scripting help

im not sure if what i want to do is advanced but for me, it is.

i am making a game which involves being able to select an ally and then select a place on the ground and then for him to move over to where i pointed. im not asking anyone to write my scripts i just simply want to know how i would write thist. I have read through many scripting tutorials but non of them tell me how to do the things i want to do. Could anyone help me with this problem in anyway.

What I would do is raycast from the mouse position like this:

var hit: RaycastHit;
if (Physics.Raycast(Camera.main.ScreenPointToRay (Input.mousePosition), hit)) {
    //Do stuff...
}

The hit variable now contains where the raycast landed. If you want to be able to look up at something, and have the ally move under it, then you will have to raycast down to get a horizontal surface. Anyway, you can get the output position from the raycast hit, and feed it to the allies pathfinding AI for it to move to that position. If you don't have one of those, you will need one to make it look good, especially if there are obstacles, or the enviroment is anything other than a perfectly flat plane. The last problem can be solved with yet more raycasting (from the allies current position, move forwards (virtually), raycast down, move to the new point), but the obstacle problem is quite tricky. Look up A* if you are interested.