ID:169728
 
How do I make it so when you talk to the spawn point man he will change your location to that point,and when you die it will take you to that point.
mob
var
deathx = 1
deathy = 1
deathz = 1
Spawn_Guy
icon = 'icon.dmi'
verb
Talk()
switch(alert("Would you like to set your spawn point here?","Change Spawn","Yes","No"))
if("Yes")
usr.deathx = usr.x
usr.deathy = usr.y
usr.deathz = usr.z
usr << "You have changed your spawn point!"
if("No")
return
mob
proc
die(mob/M)
if(src.client)
view(src) << "[M] has killed [src]!"
src.Move(src.deathx,src.deathy,src.deathz)
else
del(src)

That should work.
In response to XxDragonFlarexX
Why not just do
mob
Player
var
Spawn_Point
NPC
Spawn_Dude
verb
Talk()
switch(alert("Would you like to spawn here?","Yes","No"))
if("Yes")
usr.Spawn_Point = src
else
return
mob
proc
Death()
if(!src.Spawn_Point)
src.loc = locate(1,1,1) // Defualt spawn area
else
src.locate = locate(src.Spawn_Dude)

I do believe that is more efficient.
In response to ITG Master
ITG Master wrote:
I do believe that is more efficient.

And so it is, though that is more problematic. Suppose you implement saving, and the player decides to leave then come back, as they all eventually do. When you come back, the reference to the object will be lost.

Of course, you can alter the Read and Write functions to save the coordinates of the spawn location instead of the reference to the object itself, but then it is back on par with the code you replied to and thus does not matter.

So yes, it is more efficient; but only assuming there is no saving.