Jump to content
  • 0
Sign in to follow this  
Zirius

attachrid killedrid & killerrid assigning temp character variable

Question

Hello! I am trying to code a PVP script and wants to make use of streak counting. Basically, the streak is incremented when you kill a char, and resets to 0 when you got killed. So if I understand correctly, the code should *basically* follows:
 

OnPCDieEvent:	attachrid killedrid;	set @char,0;  <~~~~ (1)	attachrid killerrid;	set @char,@char+1;  <~~~~ (2)end; 

(1) Does "attachrid killedrid;" means, any character variable declaration will go to the character of killed char?
(2) Does "attachrid killerrid;" means, any character variable declaration will go to the killer?
 
Because I tried to do the above but I am having undesirable result.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

yup

 

this one, when the character died, the streak is reset

as long as the player die, for what ever reason, the streak is reset

-	script	kjdhfkjdshf	-1,{OnPCKillEvent:	if ( killedrid == getcharid(3) ) end;	@streak++;	dispbottom "you killed "+ rid2name( killedrid ) +". streak count "+ @streak;	end;OnPCDieEvent:	@streak = 0;	dispbottom "your current streak count "+ @streak;	end;}
.

.

.

this one, when the character die from player's hand, the streak is reset

die from other means such as suicide, killed by non-human players doesn't count

-	script	skdfjhskdf	-1,{OnPCKillEvent:	if ( killedrid != getcharid(3) ) {		@streak++;		dispbottom "you killed "+ rid2name( killedrid ) +". streak count "+ @streak;	}	attachrid killedrid;	@streak = 0;	dispbottom "your current streak count "+ @streak;	end;}

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.