Code: Select all
{
Spawn[()
{
Console(true);
BoxWidth(30);
BoxHeight(3);
if(GetAttribute("metal_grate_event", "Player") = 1)
{
NewOrder("Die");
}
else
{
RestartOrder();
}
}]
Die[()
{
Remove(true);
}]
}
Code: Select all
{
HEALTH [10]
HEALTHATTRIBUTE [enemy_health]
BOOM [Barrelboom]
Spawn[ ()
{
Console(true);
AttributeOrder(HEALTHATTRIBUTE, HEALTH, "Death");
IsPushable(false);
LowLevel("Idle");
} ]
Death[ ()
{
FadeOut(2, 0);
Remove(true);
} ]
//LowLevel routines
Idle[ ()
{
if (self.health = 0)
{
ModifyAttribute("metal_grate_event", 1, "Player");
AddExplosion("GeneralExplosion", "", 0, 0, 0);
DamageArea(30, 200, "health");
DamageArea(65, 200, "enemy_health");
HighLevel("Death");
}
} ]
}
But I guess the problem is in first script. I changed the "metal_grate_event" attribute to initial = 1, and the metal grate was still there.