Jump to content
  • 0

script respawn pvp


IsabelaFernandez

Question


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

 

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 ❤️ 

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

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 by n0tttt
  • Upvote 2
Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

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.

  • Upvote 1
  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

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;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

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

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

change :

 

ONPCDieEvent:

to

OnPCDieEvent

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  90
  • Reputation:   34
  • Joined:  10/01/18
  • Last Seen:  

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;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

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.

  • Love 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

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?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

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;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

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 ?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...