I made my door:
X: 4
Y: 48
Z: 88
(all measurements are asuming looking at map with everything sideways)
Now make a textures>common>orgin and place it at the bottom of the door inside of it
I made mine shaped like a rod going through almost like an invisible hinge...

Now select both the door and the orgin and make it a script>brushmodel
Give it the following values:
Key: Targetname
Value: Door
Now make a trigger on front side of the door
Make sure it is the size of the door and its better if its flat aginst the door so it cant be bashed from the side, only from the front...
Now hit "n" to open the entities window and check all the boxes accept for no_melee
Make it a trigger>damage
Give it the following values:
Key: Targetname
Value: door_front
Now make another trigger for the backdoor
Give it the following values:
Key: Targetname
Value door_back
Now we need to make it so if the door falls on you it kills you

Make a trigger>hurt on the front side and make it a box so if your standing in it, it will kill you...
I made mine
X: 88
Y: 48
Z: 88
Give it the following values:
Key: dmg
Value: 100
Press enter
Key: Targetname
Value: door_front_hurt
Do the same thing for the back
Give it the following values:
Key: dmg
Value: 100
Press enter
Key: Targetname
Value: door_back_hurt
Now pretty up your map with lights and fun stuff like that and compile

Now on to the scripting...
Create a new text document and save it as (mapname).gsc
Put the following code inside of it:
Code: Select all
main()
{
thread door_front();
thread door_back();
}
door_front()
{
trig = getent("door_front","targetname");
trig1 = getent ("door_front","targetname");
block = getent ("door","targetname");
kill = getent ("door_kill_front","targetname");
while (1)
{
kill thread maps\mp\_utility::triggerOff();
trig waittill ("damage", idamage);
{
block rotatepitch (90, .5, .5, 0);
wait (.5);
kill thread maps\mp\_utility::triggerOn();
block waittill ("movedone");
kill thread maps\mp\_utility::triggerOff();
trig thread maps\mp\_utility::triggerOff();
trig1 thread maps\mp\_utility::triggerOff();
}
}
}
door_back()
{
trig = getent("door_back","targetname");
trig1 = getent ("door_front","targetname");
block = getent ("door","targetname");
kill = getent ("door_kill_back","targetname");
while (1)
{
kill thread maps\mp\_utility::triggerOff();
trig waittill ("damage");
{
block rotatepitch (-90, .5, .5, 0);
kill thread maps\mp\_utility::triggerOn();
block waittill ("movedone");
kill thread maps\mp\_utility::triggerOff();
trig thread maps\mp\_utility::triggerOff();
trig1 thread maps\mp\_utility::triggerOff();
}
}
}

And Thats it...