Command to raise character + OnPCDieEvent

bWolfie

I'm the man
Messages
850
Points
0
Location
Alberta, Midgard
Github
bWolfie
Emulator
Hello,

I'm trying to make a script where:

- When player dies on X map, is warped to Y map.

- When player is warped to Y location, player is revived.

This is what I have so far, but I can't get the player to revive after moving map.

Code:
-    script    ondeath    FAKE_NPC,{
OnPCDieEvent:
    if (strcharinfo(3) == "prontera") {
        warp "prontera",150,150,0;
        atcommand "@raise";
    }
end;
}
 
OnPCDieEvent:
if(.active == 1) {
getmapxy(@mapname$,@mapx,@mapy,0);
if(@mapname$ == .map$) {
message strcharinfo(0),"AUTO REVIVING IN 5 SECONDS";
sleep2 5000;
atcommand "@alive";
warp .map$,.mapx,.mapy;
end;
} else {
end;
}
} else {
end;
}
use the command before the warp, (warp detaches the player)

example above is how i did it in the autores command

http://herc.ws/board/files/file/240-autores-auto-resurrection/

 
Last edited by a moderator:
Back
Top