I usually use a single script for this, and just setup parameters on my entities. That way I can have like 292929292 doors, but only one script to work all of them.
//Generated by BehavEd
rem ( "First block checks is door down" );
if ( $get( FLOAT, "SET_PARM1")$, $=$, $0$ )
{
set ( /*@SET_TYPES*/ "SET_PARM1", "1" );
rem ( "If it is, set to up" );
set ( /*@SET_TYPES*/ "SET_INACTIVE", "true" );
rem ( "Turn off the trigger" );
affect ( $get( STRING, "SET_PARM3")$, /*@AFFECT_TYPE*/ FLUSH )
{
rem ( "script_targetname of door" );
move ( $get( VECTOR, "SET_PARM1")$, $get( VECTOR, "SET_PARM2")$, $get( FLOAT, "SET_PARM3")$ );
rem ( "Vectors set on parms on door" );
wait ( $get( FLOAT, "SET_PARM6")$ );
rem ( "parm6 is the wait time, set on the func_static" );
affect ( $get( STRING, "SET_PARM7")$, /*@AFFECT_TYPE*/ FLUSH )
{
rem ( "String parm7 is the script_targetname of trigger" );
set ( /*@SET_TYPES*/ "SET_INACTIVE", "false" );
}
}
}
else ( )
{
set ( /*@SET_TYPES*/ "SET_PARM1", "0" );
set ( /*@SET_TYPES*/ "SET_INACTIVE", "true" );
affect ( $get( STRING, "SET_PARM3")$, /*@AFFECT_TYPE*/ FLUSH )
{
move ( $get( VECTOR, "SET_PARM4")$, $get( VECTOR, "SET_PARM5")$, $get( FLOAT, "SET_PARM3")$ );
wait ( $get( FLOAT, "SET_PARM6")$ );
affect ( $get( STRING, "SET_PARM7")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( /*@SET_TYPES*/ "SET_INACTIVE", "false" );
}
}
}
It's been a while since I used this, let me see if I remember what's going on. parm1 is the status of the door. 0 being down and 1 being up. This parm is set on the trigger_multiple initially as the key "parm1" value "0". The trigger_multiple is also given the key "usescript" and the value of this script's name and file path. At this point the script sets the trigger as inactive before continuing. This is mostly to help prevent player error. Now, the script looks at key: parm3 on your trigger. This is a string that tells it the name of the func_static you wish to move. (The script_targetname on the entity you are going to be moving.) Example: Key: parm3 Value: myCuteDoor1 Now, we are running a block of commands on myCuteDoor and thus can now fill out the parms on your cutedoor func_static entity. Parms 1 and 2 on the func_static are vectors. 1 being an origin, 2 being an angle. Parms 4 and 5 are the same. 4 being an origin, 5 being a set of angles. (This is optional. For me it's easier to do just one script to effect multiple doors. If you'd rather manually specify tags in the script, you may do so yourself.) Parm3 is a float that specifies the time it takes for the door to move. Set this to whatever you want. It's shared by both the move up and move down blocks of command. Parm6 is also set on the func static door. This is the time you wish to wait before reactivating the trigger that we initially turned off. And finally, parm7 is a string signifying the script_targetname of the trigger_multiple that was deactivated in the beginning. This parm is also set on your func_static door. This means we are running another block of commands on the trigger_multiple. This time, the only command is to make the trigger_multiple usable by setting inactive to false. There you have it! After all of that, parm1 on the trigger_multiple is no longer 0. It is now 1 and the door is up. That means the next time the trigger_multiple runs the script it will run the else block, which should have values that indicate the doors down origin.