Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 2 Votes - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting Answers
Author Message
HumiliatioN Offline
Posting Freak

Posts: 1,118
Joined: Dec 2010
Reputation: 16
Post: #11
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! Big Grin

Looking for a Perfect Wine - WIP
07-26-2011 01:35 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)