I think i made it!Finally here it is:
;Artificial Intelligence Script
;Header
desc = Search area Shoot player if seen Return fire if shot Run away if too much damage taken
;Triggers
:state=0:state=1
:state=1,losetarget=5:state=10
:state=1,plrcanbeseen,plrdistwithin=400:state=20
:state=1,shotdamage=1:rotatetoplr,state=20
:state=1,random=20:rotateheadrandom=55
:state=1:animate=2,movefore=2.5
:state=10,random=1:state=11
:state=10:rotatey=90,animate=2,movefore=2.5,state=0
:state=11:rotatey=-90,animate=2,movefore=2.5,state=0
:state=20,plrcanbeseen:state=32
:state=21,plrcannotbeseen,losetarget=1:state=10
:state=21,ifweapon=1,plrdistfurther=100:followplr=1,animate=5
:state=21,plrdistwithin=101:rotatetoplr
:state=21,ifweapon=1,plrdistwithin=301,plrcanbeseen=46:animate=1,rotatetoplr,freeze,useweapon,rundecal=6
:state=21,ifweapon=0:animate=1,freeze,state=22,setframe=6
:state=21,plrdistwithin=300,random=20:state=25
:state=21,plrdistwithin=100:state=30
:state=22:incframe=6
:state=22,frameatend=6:state=21,reloadweapon,sound=audiobank\guns\reload.wav
:state=25,random=1:state=26,setframe=4
:state=25:state=27,setframe=3
:state=26:incframe=4,strafe=90,rotatetoplr
:state=26,frameatend=4:state=21,animate=1
:state=27:incframe=3,strafe=-90,rotatetoplr
:state=27,frameatend=3:state=21,animate=1
:state=30:state=31,setframe=5
:state=31:incframe=5,strafe=180,rotatetoplr
:state=31,frameatend=5:state=21,animate=1
:state=32,plrdistwithin=250:state=33
:state=33,ifweapon=1,plrdistwithin=500:useweapon,rundecal=6
:state=33,ifweapon=0:state=34,setframe=6
:state=34:incframe=6
:state=34,frameatend=6:state=1,reloadweapon,sound=audiobank\guns\reload.wav
;End of Script
I think there might be a line or two too which is not in use...
Simply copy the codes here into a fpi file
And if you encounter any problems with it post it here!
p.s. i would like someone to tell me how he likes it!