/* This script is for:

The player may only leave the town through a "DOOR"-Object (which is attached to a waypoint), if he's got
a spec. item (in this case a map) his inventory.

Put the script into the Door-Properties/Scripts -> OnAreaTransitionClick */




void main ()
{
object oClicker = GetClickingObject();
object oTarget = GetTransitionTarget(OBJECT_SELF);
object oMap = GetItemPossessedBy(oClicker, "Map");
if (oMap == OBJECT_INVALID)
{
// Here you can put in something like
// "Hey I won't leave without a map. I don't
// want to get lost"
}
else
{
location lLoc = GetLocation(oTarget);
AssignCommand(oClicker,JumpToLocation(lLoc));
}
}





//nothing special, but for me it was hard to do since I'm not a scripting god. Thanx to the people who helped me.