(07-26-2011, 09:46 PM)MrCookieh Wrote: okay, it seems, that the boxes in certain areas get destroyed by this command:
SetPropHealth("a"+iArea+"b_*", 0);
So the health of the boxes are set to 0, and (I've never tried it) they get destroyed by this.
Try to add this line:
SetPropHealth("nameofyourbox", 0);
and watch if it gets destroyed. But be sure to uncheck the disableBreakable in the entity's menu of your box
nope it doesn't work..I get an error when I try to go into the room. I tried to name my boxes like in the game:
a1b_1 in Area_EnemyBreaksThroughDebris_1
a2b_1 in Area_EnemyBreaksThroughDebris_2
a3b_1 in Area_EnemyBreaksThroughDebris_3
and leaved the SetPropHealth("a"+iArea+"b_*", 0); at that. so my script is now:
void CollideEnemyEndCrash(string &in asParent, string &in asChild, int alState)
{
(asChild == "Area_EnemyBreaksThroughDebris_1")
BreakTunnelBoxEffect(asChild, 1);
(asChild == "Area_EnemyBreaksThroughDebris_2")
BreakTunnelBoxEffect(asChild, 2);
(asChild == "Area_EnemyBreaksThroughDebris_3")
BreakTunnelBoxEffect(asChild, 3);
}
void BreakTunnelBoxEffect(string &in sEntity, int iArea)
{
PlaySoundAtEntity("bangs", "break_wood_metal", sEntity, 0.0f, false);
PlaySoundAtEntity("bangs", "attack_launch", sEntity, 0.0f, false);
SetPropHealth("a"+iArea+"b_*", 0);
StartScreenShake(0.05f, 0.4f, 0.2f, 0.6f);
}