Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting Answers
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#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

“Life is a game, play it”
07-26-2011, 01:35 PM
Find




Users browsing this thread: 1 Guest(s)