Elastic stuff

Hi… I wish I could make a spring or some other elastic rope entity, which just connect two other entities, so that the movement of one entity will stretch or compress the rope. Same thing like the rope in tool set do. Can it be realized by lua?

Thanks guys.