Try this. I made this for a custom type of push block so IDK if it'll work.
D0 is the number of the flag that goes on the trigger spots.
Set D1 to 1 to make the secret permanent.
Code:
ffc script FlagCheck{
bool CheckFlag(int flag){
for(int i=0; i<176; i++){
if(Screen->ComboF[i]==flag||Screen->ComboI[i]==flag){
if(!Screen->isSolid(ComboX(i)+8, ComboY(i)+8))return true;
}
}
return false;
}
void run(int flag, int perm){
while(CheckFlag(flag)){
Waitframe();
}
Screen->TriggerSecrets();
Game->PlaySound(SFX_SECRET);
if(perm==1)Screen->State[ST_SECRET]=true;
}
}