IsabelaFernandez Posted November 24, 2018 Posted November 24, 2018 Hello friends, I would like a simple script to respawn from pvp. when dying after 3 ~ 4 seconds relive on the same map in a random position. map for example: pvp_y_1-2 thanks Quote
1 n0tttt Posted November 25, 2018 Posted November 25, 2018 (edited) You can use the Hikirikawa script and add maps in the array you see in the end. I edited the script a bit to use inarray rather than the loop it used. OnPCDieEvent: .@map$ = strcharinfo(3); if(inarray(.map$,.@map$) != -1){ for(.@y = 5; .@y; .@y--){ message strcharinfo(0),"You will respawn in "+.@y+" second"+((.@y > 1)?"s":"")+"."; sleep2 1000; } recovery 0; warp .@map$,0,0; } end; OnInit: setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3"; end; Edited November 25, 2018 by n0tttt 2 Quote
1 n0tttt Posted November 25, 2018 Posted November 25, 2018 Is it a custom command do you have? if not, use this: OnPCDieEvent: .@map$ = strcharinfo(3); if(inarray(.map$,.@map$) != -1){ for(.@y = 5; .@y; .@y--){ message strcharinfo(0),"You will respawn in "+.@y+" second"+((.@y > 1)?"s":"")+"."; sleep2 1000; } recovery 0; repairall; if(.size_buffs) { for(;.@i < .size_buffs;.@i+= 3) sc_start .buffs[.@i],.buffs[.@i + 1],.buffs[.@i + 2]; } warp .@map$,0,0; } end; OnInit: setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3"; // Buff Duration(ms) Lvl setarray .buffs, SC_INCREASEAGI, 5*60*1000, 10, SC_BLESSING, 5*60*1000, 10; .size_buffs = getarraysize(.buffs); end; You can add all the buffs you want in .buffs array. 1 1 Quote
0 Hijirikawa Posted November 24, 2018 Posted November 24, 2018 Untested. ONPCDieEvent: .@map$ = strcharinfo(3); if(.@map$ == "pvp_y_1-2"){ for(.@i = 5; .@i < 1; .@i--){ message strcharinfo(0),"You will respawn in "+.@i; sleep2 1000; } recovery 0; warp .@map$,0,0; } end; More flexible ONPCDieEvent: .@map$ = strcharinfo(3); for(.@i = 0; .@i < getarraysize(.map$); .@i++){ if(.@map$ == .map$){ for(.@y = 5; .@y < 1; .@y--){ message strcharinfo(0),"You will respawn in "+.@y; sleep2 1000; } recovery 0; warp .@map$,0,0; } } end; OnInit: setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3"; end; Quote
0 IsabelaFernandez Posted November 25, 2018 Author Posted November 25, 2018 1 hour ago, Hijirikawa said: Untested. ONPCDieEvent: .@map$ = strcharinfo(3); if(.@map$ == "pvp_y_1-2"){ for(.@i = 5; .@i < 1; .@i--){ message strcharinfo(0),"You will respawn in "+.@i; sleep2 1000; } recovery 0; warp .@map$,0,0; } end; More flexible ONPCDieEvent: .@map$ = strcharinfo(3); for(.@i = 0; .@i < getarraysize(.map$); .@i++){ if(.@map$ == .map$){ for(.@y = 5; .@y < 1; .@y--){ message strcharinfo(0),"You will respawn in "+.@y; sleep2 1000; } recovery 0; warp .@map$,0,0; } } end; OnInit: setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3"; end; unfortunately gave a syntax error, I do not know the reason, could you help me? http://prntscr.com/lml2lp Quote
0 LearningRO Posted November 25, 2018 Posted November 25, 2018 change : ONPCDieEvent: to OnPCDieEvent 1 Quote
0 Royr Posted November 25, 2018 Posted November 25, 2018 Try this: - script F_PVPRecovery -1,{ end; OnPCDieEvent: .@map$ = strcharinfo(3); .@nme$ = strcharinfo(0); if( .@map$ == "pvp_y_1-2" ) { for( .@s = 5; .@s >= 0; .@s-- ) { message .@nme$ ,"You will respawn in "+.@s+" second"+ ( .@s > 1 ? "s" : "") +"."; sleep2 1000; } recovery 0; warp .@map$,0,0; } end; } Quote
0 Hijirikawa Posted November 25, 2018 Posted November 25, 2018 4 hours ago, Royr said: Try this: - script F_PVPRecovery -1,{ end; OnPCDieEvent: .@map$ = strcharinfo(3); .@nme$ = strcharinfo(0); if( .@map$ == "pvp_y_1-2" ) { for( .@s = 5; .@s >= 0; .@s-- ) { message .@nme$ ,"You will respawn in "+.@s+" second"+ ( .@s > 1 ? "s" : "") +"."; sleep2 1000; } recovery 0; warp .@map$,0,0; } end; } Isn't this basically the same thing? Lmao, anyways either will do. 5 hours ago, melv0 said: change : ONPCDieEvent: to OnPCDieEvent ^ Change the event label to what this guy says, sorry, my mistake. 1 Quote
0 IsabelaFernandez Posted November 25, 2018 Author Posted November 25, 2018 11 hours ago, Hijirikawa said: Isn't this basically the same thing? Lmao, anyways either will do. ^ Change the event label to what this guy says, sorry, my mistake. 17 hours ago, melv0 said: change : ONPCDieEvent: to OnPCDieEvent It worked perfectly as I wanted to thank you both! one more question, if I wanted to do this for other maps, will I need other scripts and just edit the map or can I add in that same script to avoid multiple scripts? Quote
0 IsabelaFernandez Posted November 25, 2018 Author Posted November 25, 2018 48 minutes ago, n0tttt said: You can use the Hikirikawa script and add maps in the array you see in the end. I edited the script a bit to use inarray rather than the loop it used. OnPCDieEvent: .@map$ = strcharinfo(3); if(inarray(.map$,.@map$) != -1){ for(.@y = 5; .@y; .@y--){ message strcharinfo(0),"You will respawn in "+.@y+" second"+((.@y > 1)?"s":"")+"."; sleep2 1000; } recovery 0; warp .@map$,0,0; } end; OnInit: setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3"; end; Thank you, I'll test and notify if it worked, one more question ... how do I use a command created when reborn? I would like to use @buffs and @repairall Quote
0 n0tttt Posted November 25, 2018 Posted November 25, 2018 Here you go: OnPCDieEvent: .@map$ = strcharinfo(3); if(inarray(.map$,.@map$) != -1){ for(.@y = 5; .@y; .@y--){ message strcharinfo(0),"You will respawn in "+.@y+" second"+((.@y > 1)?"s":"")+"."; sleep2 1000; } recovery 0; repairall; atcommand "@buffs"; warp .@map$,0,0; } end; OnInit: setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3"; end; Quote
0 IsabelaFernandez Posted November 25, 2018 Author Posted November 25, 2018 12 minutes ago, n0tttt said: Here you go: OnPCDieEvent: .@map$ = strcharinfo(3); if(inarray(.map$,.@map$) != -1){ for(.@y = 5; .@y; .@y--){ message strcharinfo(0),"You will respawn in "+.@y+" second"+((.@y > 1)?"s":"")+"."; sleep2 1000; } recovery 0; repairall; atcommand "@buffs"; warp .@map$,0,0; } end; OnInit: setarray .map$, "pvp_y_1-2","guild_vs2","guild_vs3"; end; the @repairall command worked, but @buffs do not Quote
Question
IsabelaFernandez
Hello friends, I would like a simple script to respawn from pvp. when dying after 3 ~ 4 seconds relive on the same map in a random position. map for example: pvp_y_1-2
thanks
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.