Even though I'm still new grin , I can offer advice on how I would do it.

I would try writing an event function that would just stop movement if player has collided with another entity with the same flag (lets say flag3).