My home is set on floor height 2 and when you die you end up on 1 how would I make them come back on level 2?

Second one would be how could you make it teleport someone if they are 1 square away with x axis +1 and y axis +2 someone please help!!