Experience Posted December 6, 2015 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 22 Reputation: 1 Joined: 11/23/11 Last Seen: December 27, 2015 Share Posted December 6, 2015 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. Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted December 6, 2015 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted December 6, 2015 if both commands are mean to trigger by the same way, then it's okay for you to merge together. Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted December 6, 2015 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted December 6, 2015 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. Quote Link to comment Share on other sites More sharing options...
0 Experience Posted December 6, 2015 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 22 Reputation: 1 Joined: 11/23/11 Last Seen: December 27, 2015 Author Share Posted December 6, 2015 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.. Quote Link to comment Share on other sites More sharing options...
Question
Experience
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??
Thank you in advanced.
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.