void main() { /// opens a door with the same tag as the object calling the script, plus _dr object oPC=GetEnteringObject(); object oObject=GetObjectByTag(GetTag(OBJECT_SELF)+"_dr"); if (GetIsObjectValid(oPC)&&GetIsPC(oPC)&&(GetLocalInt(oPC,"troll")==TRUE)) { AssignCommand(oObject,SetLocked(oObject,FALSE)); AssignCommand(oObject,ActionOpenDoor(oObject)); } }