Author Sticky: Post Working Scripts Here
TheRealCyber Posted: Friday, 19 July 08:52PM
'Airlock' Door

This is a system I had to invent for my module, which is upcoming. Basically, when you open the 'eastbackdoor', it activates this script. First, it (forces) sends you to the waypoint 'east_middile', and then shuts the door behind you, then opens the 'eastfrontdoor' and 'eastoutsidedoor', then sends you through the door leading outside. When you get outside, it shuts both the 'eastfrontdoor' and 'eastoutsidedoor'.

NOTES: eastbackdoor should be the door you open to activate this command. eastfrontdoor should be the door that is on the same Area, but needs to be the second door of the 'airlock system'. The eastoutsidedoor should be the door on the area you want the target player to go to.

NOTES 2: You need to set three waypoints for this to work. east_middile should be between the two doors (eastfrontdoor & eastbackdoor), east_outside should be at the edge of the module, just outside of the eastfrontdoor, and east_outside_cr should be just outside the eastoutsidedoor.

NOTES 3: Feel free to change these as you want to. I just needed 'east' to remember that these were the 'east' doors. (I kinda can't remember things that much)

The Script

NWScript:
void main()

{

    object oPC = GetLastOpenedBy();

    AssignCommand(oPC,ActionForceMoveToLocation(GetLocation(GetObjectByTag("east_middle")), 1, 30.0));

    ActionWait(2.0);

    ActionCloseDoor(GetObjectByTag("EastBackDoor"));

    ActionWait(2.0);

    ActionOpenDoor(GetObjectByTag("EastFrontDoor"));

    ActionOpenDoor(GetObjectByTag("EastOutsideDoor"));

    ActionWait(1.0);

    AssignCommand(oPC,ActionForceMoveToLocation(GetLocation(GetObjectByTag("east_outside")), 1, 30.0));

    ActionWait(1.0);

    AssignCommand(oPC,ActionJumpToLocation(GetLocation(GetObjectByTag("east_outside_cr"))));

    ActionWait(2.0);

    ActionCloseDoor(GetObjectByTag("EastFrontDoor"));

    ActionCloseDoor(GetObjectByTag("EastOutsideDoor"));

}



TRC out