Disabling perception on "killed" NPCs

Can you show the code for perception updated please?