Well, I'm not sure exactly, but I'm almost entirely sure that it uses the scripting command "sethealingplace", which basically sets the place that you go to when you die. For how to use it and stuff, you'd better ask someone like HackMew, 'cuz I've never used it in a script before, so I dunno how it works.