The story
Sense 1 and sense 3 are puns based on their similar pronunciations. Sense 2 is a metonym derived from the use of rope as a method of suicide; compare the verb rope (“to commit suicide, particularly by hanging”).
Etymology from Wiktionary, CC BY-SA 4.0.