# What you have - foreach { - if <%value%.id> != %value%.id && ]> != { - remove %value% } } # what it should be - foreach { - if <%value%.id> != %value%.id && ]> != null { - remove %value% - flag global removeablenpcs:->:%value% } }