Jump to content
  • 0

out of area 'OnTouch:'


luizragna

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  107
  • Reputation:   27
  • Joined:  02/12/14
  • Last Seen:  

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

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

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

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  107
  • Reputation:   27
  • Joined:  02/12/14
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

Perfect!

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