This script works with the model that can be found right here and it's called badguy1.act.
The script you want to use is:
Code: Select all
{
Spawn[()
{
Console(false);
AttributeOrder("enemy_health",150,"Die");
FindTargetOrder(200,"Alert","health");
SetFOV(360);
HostilePlayer(true);
HostileSame(false);
HostileDifferent(false);
SetGroup("Enemy");
}]
Die[()
{
AnimateStop("die",0,"");
FadeOut(3,0);
Remove(true);
}]
Alert[()
{
PlayerDistOrder(-800,"LostTarget");
AnimateStop("idle",0,"");
NewOrder("Attack");
}]
Attack[()
{
RotateToPlayer("walk",160,false,"");
FireProjectile("pistol_shell","BIP01 R FOREARM",0,0,0,
"health","");
if(self.player_range>96)
{
MoveForward("walk",50,50,"");
}
else
{
Delay("hit",1,"");
}
RestartOrder();
}]
LostTarget[()
{
BlendToAnimation("idle",1,true,"");
FindTargetOrder(200,"Alert","health,");
}]
}
Code: Select all
[badguy1]
actorname = badguy1.act
actorrotation = 270 180 0
actorscale = 1.4
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = true
boundingboxanimation = idle
shadowsize = 64