Note: All Redundant Lines Are Removed... This includes animations and comments, it is just easier to check it without them
plrcanbeseen and plringunsight are complements, use one, not both.
plrcanbeseen has no value. =46 is redundant
settarget during shooting, or constantly
rotateheadrandom should not be greater then 45... can you turn your head all the way around?
noiseheard is a field, like distance, 1 means 1 cm, 100 mean 1 m.
noraycastup means that there is no object ABOVE the enemy.
now, if you look at this, your problem becomes immediatly appearent.
You only told the enemy to move WHEN he WAS shot. AND he is stuck on state 5, meaning that he will stay there forever.
::settarget
:state=0,plrcanbeseen:state=1
:state=0,noiseheard=500:state=3
:state=0,shotdamage=1:state=5
:state=1:rotatetoplr
:state=1,ifweapon=1,plrcanbeseen,rateoffire:useweapon
:state=1,ifweapon=0:state=2,setframe=6
:state=2:incframe=6
:state=2,frameatend=6:state=1,reloadweapon,sound=audiobank\guns\reload.wav
:state=3,random=20:rotateheadrandom=70
:state=3,plrcanbeseen:state=1
:state=3,shotdamage=1:state=5
:state=5:movefore=4
:state=5,raycast=0 100:rotatey=4
"ye oft de adopte early shalt move mountains, and be gods among men"
He who knows everything knows nothing at all.