ID:179574
 
I've read what Dream Maker has to say on walk_to and from what I can tell, walk_to does not return a value.

If this is the case, how would I make it so that something ONLY happens after it walks to the object that was clicked. I tried using get_dist to check if the distance was 1 but I couldn't store that info in a variable.
I'm kind of new here but this code might work.

mob/person_clicked
icon='person.dmi'
Click()
if(get_dist(src,usr)>=4)
walk_to(src,usr,1,0)
else
usr<<"Get away from me if you're going to be clicking on me!"
In response to Light
Putting get_dist() in if() gives me a bad assignment error.
In response to Evilkevkev
I got it to work by checking to see if the distance was greater of less than 1 and then if no it works as normal. It's a waste of code but it works.

[EDIT]
My problem is now, that my Click() proc doesn't wait until walk_to() finishes to check the distance. This probably has everything to do with the fact that walk_to() returns after every step. Any way to solve this?