Jump to content
  • 0
luizragna

out of area 'OnTouch:'

Question

Hello. I'm doing an NPC in the persagem receive damage while listening to him. I would like to do with that when he got out of close looks from receiving damage.

pay_arche,63,145,4	script	Guard#2	45,3,3,{
	
	

OnTouch:

set @fire,1;

while (@fire == 1){
specialeffect2 49,"+strcharinfo(0)+";
heal -2,0;
sleep2 500;
}

}

I don't know if I'm doing the right way....

Basically I wish the variable @fire  came back to = 0

Edited by luizragna
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 2

You need to include a check for getmapxy () and see if the char is still within the area... if not set char var fire to 0

Edited by Z3R0
  • Upvote 2
Link to comment
Share on other sites

  • 1
59 minutes ago, Z3R0 said:

You need to include a check for getmapxy () and see if the char is still within the area... if not set char var fire to 0

Thanks! I Solved!

pay_arche,63,145,4	script	Guard#2	45,3,3,{
	
	

OnTouch:

set @fire,1;

while (@fire == 1){
specialeffect2 49,"+strcharinfo(0)+";
heal -2,0;
sleep2 500;

       getmapxy(@mapname$, @mapx, @mapy, UNITTYPE_PC, ""+strcharinfo(0)+"");

		if ((@mapx < 60) || (@mapx > 65) || (@mapy < 143) || (@mapy > 147))
			@fire = 0;

}
}

 

  • Upvote 1
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...

Important Information

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