02-06-2013, 06:44 AM
I have a brute to walk into an area and a door will break, and it just wont work, just the sanity loss when he walks into it... Here is the code.
Code:
void OnStart ()
{
AddEntityCollideCallback("brute1", "poof", "disspear", true, 1);
AddEntityCollideCallback("brute1", "break2", "break2", true, 1);
AddEntityCollideCallback("brute1", "break3", "break3", true, 1);
AddEntityCollideCallback("brute1", "break4", "break4", true, 1);
AddEntityCollideCallback("brute1", "AreaPushDoor", "break1", true, 1);
}
void break2(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("BDoor2", -1);
GiveSanityDamage(0.1f, true);
}
void break3(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("BDoor3", -1);
GiveSanityDamage(0.1f, true);
}
void break4(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("prison", -1);
GiveSanityDamage(0.1f, true);
}
void break1(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("realdoor", -1);
GiveSanityDamage(0.1f, true);
}