OnStart(){
SetEntityPlayerInteractCallback("yourmonsterspawndoor", "SpawnMonster", true);
}
void SpawnMonster(string &in asEntity){
//Add your monster spawning stuff here
AddEntityCollideCallback("Player", "yourescapedoorarea", "CloseDoor", true, 1);
}
void CloseDoor(string &in asParent, string &in asChild, alState){
SetSwingDoorClosed("yourescapedoor", true, true);
}
1 is when you enter your area, -1 when you leave it, and 0 for both.
So what the script does:
When you touch the door, you add your monster stuff, like spawning.
After that it activates an entity collide callback, which triggers, when
the player enters your escapearea in front of your escapedoor.
Then it closes, and the payer lost some seconds