can someone tell me how to revert a screen secret when the player is no longer stepping on the pressure plate?
I also need a way of check if every pressure plate is down
here is my script
const int STEP_COMBO_TYPE = 192; ffc script PressurePlate_Timed { int timer = 0; int index; void run( int combo, int time, bool all, bool pushblock) { while(true) { if((!LinkCollisionExt(this, -6, -12, -8, -8)) || (pushblock && PushBlockAtLoc(ComboAt(this->X, this->Y)))) { timer -= 1; if (timer <= 0) { //Check if all flag is set //Check if all ffc's running this script are pressed //revert secrets index = ComboAt(this->X, this->Y); Screen->ComboD[index] = combo; } } else { //trigger secrets index = ComboAt(this->X, this->Y); Screen->ComboD[index] = combo+1; timer = time; } Waitframe(); } } } bool LinkCollisionExt(ffc this, int top, int bottom, int left, int right) { int ffcRect[4] = {HitboxLeft(this) - left, HitboxTop(this) - top, HitboxRight(this) + right, HitboxBottom(this) + bottom}; int linkRect[4] = {HitboxLeft(), HitboxTop(), HitboxRight(), HitboxBottom() }; Screen->Rectangle(6, ffcRect[0], ffcRect[1], ffcRect[2], ffcRect[3], 21, -1, 0, 0, 0, false, 128); Screen->Rectangle(6, linkRect[0], linkRect[1], linkRect[2], linkRect[3], 21, -1, 0, 0, 0, false, 128); if (linkRect[0] > ffcRect[2] || ffcRect[0] > linkRect[2]) return false; if (linkRect[1] > ffcRect[3] || ffcRect[1] > linkRect[3]) return false; return true; } bool PushBlockAtLoc(int loc){ bool re = false; if( Screen->ComboF[loc]==CF_PUSHUPDOWN || Screen->ComboF[loc]==CF_PUSH4WAY || Screen->ComboF[loc]==CF_PUSHLR || Screen->ComboF[loc]==CF_PUSHUP || Screen->ComboF[loc]==CF_PUSHDOWN || Screen->ComboF[loc]==CF_PUSHLEFT || Screen->ComboF[loc]==CF_PUSHRIGHT || Screen->ComboF[loc]==CF_PUSHUPDOWNNS || Screen->ComboF[loc]==CF_PUSHLEFTRIGHTNS || Screen->ComboF[loc]==CF_PUSH4WAYNS || Screen->ComboF[loc]==CF_PUSHUPNS || Screen->ComboF[loc]==CF_PUSHDOWNNS || Screen->ComboF[loc]==CF_PUSHLEFTNS || Screen->ComboF[loc]==CF_PUSHRIGHTNS || Screen->ComboF[loc]==CF_PUSHUPDOWNINS || Screen->ComboF[loc]==CF_PUSHLEFTRIGHTINS || Screen->ComboF[loc]==CF_PUSH4WAYINS || Screen->ComboF[loc]==CF_PUSHUPINS || Screen->ComboF[loc]==CF_PUSHDOWNINS || Screen->ComboF[loc]==CF_PUSHLEFTINS || Screen->ComboF[loc]==CF_PUSHRIGHTINS ) re = true; if( Screen->ComboI[loc]==CF_PUSHUPDOWN || Screen->ComboI[loc]==CF_PUSH4WAY || Screen->ComboI[loc]==CF_PUSHLR || Screen->ComboI[loc]==CF_PUSHUP || Screen->ComboI[loc]==CF_PUSHDOWN || Screen->ComboI[loc]==CF_PUSHLEFT || Screen->ComboI[loc]==CF_PUSHRIGHT || Screen->ComboI[loc]==CF_PUSHUPDOWNNS || Screen->ComboI[loc]==CF_PUSHLEFTRIGHTNS || Screen->ComboI[loc]==CF_PUSH4WAYNS || Screen->ComboI[loc]==CF_PUSHUPNS || Screen->ComboI[loc]==CF_PUSHDOWNNS || Screen->ComboI[loc]==CF_PUSHLEFTNS || Screen->ComboI[loc]==CF_PUSHRIGHTNS || Screen->ComboI[loc]==CF_PUSHUPDOWNINS || Screen->ComboI[loc]==CF_PUSHLEFTRIGHTINS || Screen->ComboI[loc]==CF_PUSH4WAYINS || Screen->ComboI[loc]==CF_PUSHUPINS || Screen->ComboI[loc]==CF_PUSHDOWNINS || Screen->ComboI[loc]==CF_PUSHLEFTINS || Screen->ComboI[loc]==CF_PUSHRIGHTINS ) re = true; else if( Screen->ComboT[loc]==CT_PUSHHEAVY || Screen->ComboT[loc]==CT_PUSHHEAVY2 || Screen->ComboT[loc]==CT_PUSHHEAVY2WAIT || Screen->ComboT[loc]==CT_PUSHHEAVYWAIT || Screen->ComboT[loc]==CT_PUSHWAIT ) re = true; return re; }
Edited by Shadowblitz16, 21 January 2017 - 11:29 PM.