Rope constraint attached to players that moves with a part

This is a bit of complicated, but I want a part to move away from a player when they get near it, and that part adds a rope constraint that is attached to the players Torso (triggered by an OnTouch part), but stops when they touch another OnTouch part. What script is most viable for this?