Yeah, what's happening is that it's seeing:
if(posn(o0,35,104,140,120)) {
set(f103);
}
else {
print("My text.'");
}
And if it's not near the person in that third if statement, no matter whether it's near any of the others, it's going to the else and returning the message.
It'd be nifty if AGI had an 'else if' to go with the if and else; things like this would be a lot simpler. But you can either use returns as said, or just nest the if statements to simulate an 'else if':
if(said("talk","man")){
if(posn(o0,50,125,65,137)) {
set(f100);
}
else {
if(posn(o0,5,115,20,140)) {
set(f101);
}
else {
if(posn(o0,106,126,124,145)) {
set(f102);
}
else {
if(posn(o0,35,104,140,120)) {
set(f103);
}
else {
print("My text.'");
}
}
}
}
}