HumiliatioN
Posting Freak
Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation:
18
|
RE: Scripting Answers
(07-26-2011, 01:34 PM)Kyle Wrote: Try this:
void OnStart()
{
AddEntityCollideCallback("Player", "BlowDoor", "BlowDoorFunction", true, 1);
}
void BlowDoorFunction(string &in asParent, string &in asChild, int alState)
{
AddTimer("aha", 0.1, "OpenDoor");
AddTimer("aso", 0.3, "OpenDoor");
StartPlayerLookAt("blow_door", 3, 1, "");
}
void OpenDoor(string &in asTimer)
{
if(asTimer == "aha"){
AddPropImpulse("blow_door", -0.5f, 0, 0.5f, "World");
GiveSanityDamage(20.0f,true);
PlaySoundAtEntity("", "scare_tingeling.snt", "Player", 0, true);
}
if(asTimer == "aso"){
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, true);
StopPlayerLookAt();
}
}
Now it works. Thanks!
“Life is a game, play it”
|
|
07-26-2011, 01:35 PM |
|