I am trying to make it so that a character will follow a waypoint, if he sees me, start shooting. This is easy enough, but what I am trying to get the character to do is go back to the waypoint if I run away A.K.A, he can't see me. I can't get that part to work.
Here's the .fpi file for the character's Main propery
;Artificial Intelligence Script
;Header
desc = Pace Waypoints, If See Player, Rotate And Shoot
;Triggers
:waypointstate=0:animate=2,waypointstart
:waypointstate=3:animate=2,waypointnext
:waypointstate=4:animate=2,waypointrandom
:waypointstate=5:animate=2,waypointreverse
:plrcanbeseen=0:settarget,activatetarget=2,animate=1,state=0
:state=0:state=1
:state=1,plrcanbeseen:settarget,state=2
:state=1,random=20:rotateheadrandom=65
:state=1,random=60:rotatetoplr
:state=1,shotdamage=10:settarget,animate=1,rotatetotarget,resethead,state=2
:state=1,noiseheard=5:settarget,rotatetotarget,rotatetoplr
:state=2:waypointstop,rotatetoplr,state=3,shootplr
:state=3:animate=1,state=1
;End of Script
And here is the code for the characters Shoot property
;Artificial Intelligence Script
;Header
desc = Look and Shoot
;Triggers
:state=0,plrcanbeseen:state=1,settarget
:losetarget=10:runfpidefault=1
:state=0:runfpidefault=1
:state=1:rotatetoplr
:state=1,ifweapon=1,plrcanbeseen=46,plringunsight,rateoffire:useweapon,rundecal=6
:state=1,ifweapon=0:state=2,setframe=6
:state=1,plrcannotbeseen:waypointstart,runfpi=pace20.fpi
:state=2:incframe=6
:state=2,frameatend=6:state=1,reloadweapon,sound=audiobank\guns\reload.wav
:state=2,plrcannotbeseen:runfpi=pace20.fpi
;End of Script
Any help at all is greatly appreciated as I am very n00bish!