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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using a Timer to Unlock a Door
AGP Offline
Senior Member

Posts: 448
Threads: 45
Joined: Dec 2012
Reputation: 23
#5
RE: Using a Timer to Unlock a Door

Okay, so the player hits a script area named "timer_area" and then after 42 seconds, the door named "hall_door" would unlock. The door is already set to locked in the editor.

This script probably looks like the world's biggest mess....
In OnStart()
    {
    AddEntityCollideCallback("Player", "timer_area", "OpenDoor", true, -1);
    }

void OpenDoor()
{
    AddTimer("ExampleTimer",42f,"TimerCall");
}

void TimerCall(string &in asTimer)
{
   SetSwingDoorClosed("hall_door", false, true);
}

05-06-2013, 06:13 PM
Find


Messages In This Thread
Using a Timer to Unlock a Door - by AGP - 05-06-2013, 05:13 PM
RE: Using a Timer to Unlock a Door - by AGP - 05-06-2013, 05:36 PM
RE: Using a Timer to Unlock a Door - by AGP - 05-06-2013, 06:13 PM
RE: Using a Timer to Unlock a Door - by AGP - 05-06-2013, 06:27 PM
RE: Using a Timer to Unlock a Door - by AGP - 05-06-2013, 06:32 PM
RE: Using a Timer to Unlock a Door - by AGP - 05-06-2013, 06:49 PM



Users browsing this thread: 3 Guest(s)