AI that 'turns the other way' when player camoflauges.

Hey all. I’m working on a 3d platformer in which the main character (a chameleon) changes color to avoid enemy detection… however, I’m having a hard time programming it. After discovering what seems to be the solution here: (…ility/flcsya1/), any attempts at doing the same have proven fruitless. I think I’m stuck at the “toggle” part of the solution…I’ve done everything the dude has done but no dice. I’m including screenshots of the basic AI script and the player camoflauge for reference. Please help! I’m very clueless.