Here is the code/download
;CODE X FPI file (MAIN)
desc = ally follows waypoints, shoots at enemies, heals player, and gives ammo. (see X10 manuel\CODE_X10-1)
:settargetname=enemy
:setvar1=plrhealth
:setvar2=quantity
:waypointstate=0:animate=2,waypointstart
:waypointstate=3:animate=2,waypointnext
:waypointstate=4:animate=2,waypointrandom
:waypointstate=5:animate=2,waypointreverse
:nearactivatable=0:settargetname=enemy,activatetarget=2,animate=1,state=0
:state=0,keypressed=59:state=5
:state=0,keypressed=60:state=10
:state=0,keypressed=62:state=20
;state=0,keypressed=63:state=25
:state=5,keypressed=61:state=0
:state=10,keypressed=61:state=0
:state=11,keypressed=61:state=0
:state=12,keypressed=61:state=0
:state=20,keypressed=61:state=0
:state=25,keypressed=61:state=0
:state=0,waypointstart
:state=5,animate=5,rotatetoplr,followplr
:state=10:animate=1,reloadweapon,sound=gamecore\guns\modernday\uzi\reload.wav:state=11
:state=11,settargetname=enemy,rotatetotarget:state=12
:state=11,targetactive=0:state=0
:state=11,weapon=0:state=10
:state=12,animate=31,useweapon,rundecal=6,random=3,shotdamage=10:state=10
:state=20,var1less=90:rotatetoplr,sound=audiobank\items\heathup.wav,var1add=10:state=5
:state=20,var1=100:state=0
:state=25,var2less=1:rotatetoplr,sound=audiobank\items\pickupweapon.wav,var2add=1:state=5
:state=25,var2greater=0:state=0
;end of script
;CODE X scripts are made by FIRST MAN STUDIOS
FIRST MAN STUDIOS