ID:271500
 
How do I make it so when a person dies, they are converted to a spawning point instead of being disconnected?
mob
var
HP= 10 //Make a HP var
verb
Die() //Just an example
src << "You died!" //You don't have to use src.....
src.HP-=10 //Lose all HP
src.loc= locate(1,1,1) //locate the player after he/she dies
src.HP= 10 //The player gets his/her HP back

Read a tutorial. If you can make a Death proc, you should be able to change their location.
mob/proc/DeathCheck(mob/killer)//to define a killer, just do something such as src.DeathCheck(killer). src representing the person dying and killer representing whoever killed that person.
if(src.hp<=0)//if health is less than 0.
var/saveloc=src.loc//create a variable to save the dying person's location. This can be used as the spawning point.
src.loc=null//move the mob nowhere or if you want, use locate(x,y,z) to place him in a temporary location
spawn(100) src.loc=saveloc//in 10 seconds, spawn the dying person back to his original location to where before he died.
src.hp=src.maxhp//refill health to the max. this happens before the 10 seconds are up because spawn is being used.
In response to DadGun
DadGun wrote:
> mob
> var
> HP= 10 //Make a HP var
> verb
> Die() //Just an example
> src << "You died!" //You don't have to use src.....
> src.HP-=10 //Lose all HP
> src.loc= locate(1,1,1) //locate the player after he/she dies
> src.HP= 10 //The player gets his/her HP back
>


Thats not really effective. What if the player had more then 10 HP? Why not just make their HP equal 0?
In response to RedlineM203
o.O The HP is not what matters in this topic. ;)
In response to DadGun
DadGun wrote:
o.O The HP is not what matters in this topic. ;)

It may or may not but giving them code that works only if they have 10 hp is not smart.