Jump to content
  • 0

About: "dup label : OnTouch" error.


Experience

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   1
  • Joined:  11/23/11
  • Last Seen:  

Hello...

 

I'm making a script, however, I've been getting error on "OnTouch:" label, because I'm using two in one single script..

My question is, in this case if I name the second OnTouch: as OnTouch2: would it works, or theres any solution for this case??

Same is happening with a "OnMyMobDead:", there are some rule to avoid it or just creating a secondary name will fix it??

script error on npc/*.txt line 102
    set_label: dup label
    97 :        mes "";
    98 :        mes "";
    99 :        mes "";
   100 :        close;
   101 :
*  102 : 'O'nTouch:
   103 :        if (isequipped(5038) || isequipped(2257) || isequipped(2256)) {
   104 :                mes "";
   105 :                mes "";
   106 :                close;
   107 :        }

Thank you in advanced.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

if both commands are mean to trigger by the same way, then it's okay for you to merge together.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

there are 3 types of OnTouch* event.

OnTouch:

This label will be executed if a trigger area is defined for the NPC object it's 
in. If it isn't present, the execution will start from the beginning of the NPC 
code. The RID of the triggering character object will be attached.
OnTouch_:

Similar to OnTouch, but will only run one instance. Another character is
chosen once the triggering character leaves the area.


OnTouchNPC:

Similar to OnTouch, but will only trigger for monsters. For this case, by using
'getattachedrid' will returns GID (ID that returned when use 'monster').

similar cant exist more than one time within same npc script.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   1
  • Joined:  11/23/11
  • Last Seen:  

Thank you @Emistry..

 

This the full code (without "mes"):

niflheim,195,211,6	script	Gigantia#nif	796,3,3,{
	if(lang_pt == 0) {
	if (isequipped(5038) || isequipped(2257) || isequipped(2256)) {
		mes "[" + strcharinfo(0) + "]";
		mes "";
		close;
	}
	mes "";
	close;

OnTouch:
	if (isequipped(5038) || isequipped(2257) || isequipped(2256)) {
		mes "";
		close;
	}
	end;
} else {
	if (isequipped(5038) || isequipped(2257) || isequipped(2256)) {
		mes "";
		close;
	}
	mes "";
	close;

OnTouch:
	if (isequipped(5038) || isequipped(2257) || isequipped(2256)) {
		mes "";
		close;
	}
	end;
}
}

So, based on what you told me, I can't use the two OnTouch in the same script, so an alternative way to deal with it would be make it work in one single stance, something like it, may work??

niflheim,195,211,6	script	Gigantia#nif	796,3,3,{
OnTouch:
    if (isequipped(5038) || isequipped(2257) || isequipped(2256)) {
        mes "";
        close;
    }
    end;

if(lang_pt == 0) {
	if (isequipped(5038) || isequipped(2257) || isequipped(2256)) {
		mes "[" + strcharinfo(0) + "]";
		mes "";
		close;
	}
	mes "";
	close;
} else {
	if (isequipped(5038) || isequipped(2257) || isequipped(2256)) {
		mes "";
		close;
	}
	mes "";
	close;
}
}

Haven't tested, so I'm just trying to figure a way to fix it.. ^_^

 

Thank you in advanced..

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