I've been working on this AI script for hours and just can't stand it anymore! For some reason the AI doesn't follow the first part of the script, the part that is state=0. The AI doesn't react to me shooting him, being within the distince, hearing a noise, or anything. But, the AI does try to walk straight to my spawn zone as soon as he spawns walking straight into the wall or any other objects. The script is attached. If somebody can please help I thank you!
;Artificial Intelligence Script
;Header
desc = Advanced AI
:plralive=0:animate=1,state=0
:state=0,noiseheard=400:rotatetoplr,state=1
:state=0,plrdistwithin=500:rotatetoplr,settarget,state=1
:state=0,plrcanbeseen:rotatetoplr,settarget,state=1
:state=0,shotdamage=1:rotatetoplr,settarget,state=1
:state=1,ifweapon=0:state=2,setframe=6
:state=1,plrdistfurther=1000,plrcanbeseen:rotatetoplr,state=5
:state=1,plrdistfurther=1000,plrcannotbeseen:state=5
:state=1,plrdistwithin=1000,plrcanbeseen,rateoffire:rotatetoplr,settarget,useweapon,rundecal=6
:state=1,plrdistwithin=1000,plrcannotbeseen:rotateheadrandom=75,state=5
:state=1,plrdistwithin=500,rateoffire:rotatetoplr,settarget,useweapon,rundecal=6
:state=1,shotdamage=1:state=3,setframe=3
:state=2:incframe=6
:state=2,frameatend=6:state=1,reloadweapon,sound=audiobank\guns\reload.wav
:state=3:incframe=3
:state=3,random=1:rotatetoplr,strafe=90,rotatetoplr
:state=3,random=2:rotatetoplr,strafe=-90,rotatetoplr
:state=3,frameatend=3:animate=1,state=1
:state=5:animate=2,followplr
:state=5,plrdistwithin=500:state=1
:plrdistfurther=2000:state=01
:state=01:animate=1,floorlogic
;End of Script