That's basic state AI
You code would look something like:
You code would look something like:
If entitydistance(badguy,player)<chasedistance and badguystate = roam If the badguy can see the player (linepick) badguy go into chase mode, chasing player endif endif if entitydistance(badguy,player)<attackdistance and badguystate=chase attack player endif if entitydistance(badguy,player)>chasedistance then badguystate=roam if badguystate=roam then bumble around if badguystate=attack then smack,smash,destroy if badguystate=chase where's the good guy. Point at him Move towards him endif