void main() { string sTag=GetTag(OBJECT_SELF); string sNum=GetStringRight(sTag,1); object oGuardian=GetNearestObjectByTag("GL_S_"+sNum); object oPC=GetExitingObject(); object oMod=GetModule(); int nNum=GetLocalInt(oMod,sTag); int nV=StringToInt(sNum); object oTarget; string sPos="1"; string sGroup="1"; int nMath; if (sNum=="3"||sNum=="4") sGroup="2"; else if (sNum=="5"||sNum=="6") sGroup="3"; else if (sNum=="7"||sNum=="8") sGroup="4"; oTarget=GetNearestObjectByTag("PORTAL_LIGHT"+sGroup,oPC,1); nNum--; SetLocalInt(oMod,sTag,nNum); DeleteLocalInt(oPC,sTag); nMath=nV/2; if (nMath*2==nV) sPos="2"; nMath=GetLocalInt(oTarget,"nInPlace"+sPos); nMath--; SetLocalInt(oTarget,"nInPlace"+sPos,nMath); }