Problem with Gate overlapping event not triggering

Is this code in the NPC?