dungpt8782 0 Posted June 27, 2014 function script Test { mes "[Test]"; for(set .@i,1; getd(".@F"+.@i+"[0]"); set .@i,.@i+1) mes " .@F+.@i+"[0] is exist"; close; OnInit: setarray .@F1[0],30712,1,30711,2; setarray .@F2[0],30713,1,30712,2; end;} function script Test { mes "[Test]"; for(set .@i,1; getd(".@F"+.@i+"[0]"); set .@i,.@i+1) mes " .@F+.@i+"[0] is exist"; close; OnInit: setarray .@F1[0],30712,1,30711,2; setarray .@F2[0],30713,1,30712,2; end;} How to make FOR work in case the conditions of the test variables exist? I made this script and work good with rAthena, but did not work in Hercules Somebody help me pls!!!! Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted June 27, 2014 function script Test { mes "[Test]"; for(set .@i,1; getd(".@F"+.@i+"[0]"); set .@i,.@i+1) mes ".@F"+.@i+"[0] is exist"; close; OnInit: setarray .@F1[0],30712,1,30711,2; setarray .@F2[0],30713,1,30712,2; end;} function script Test { mes "[Test]"; for(set .@i,1; getd(".@F"+.@i+"[0]"); set .@i,.@i+1) mes ".@F"+.@i+"[0] is exist"; close; OnInit: setarray .@F1[0],30712,1,30711,2; setarray .@F2[0],30713,1,30712,2; end;} missing ", but can't understand what you are trying to do with that for command :? You can always check your script for errors at http://haru.ws/scriptchecker/ or at map-server console Quote Share this post Link to post Share on other sites
0 dungpt8782 0 Posted June 27, 2014 (edited) edited Edited June 27, 2014 by dungpt8782 Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted June 27, 2014 why not replace .@F with .F ? Quote Share this post Link to post Share on other sites
0 dungpt8782 0 Posted June 27, 2014 On 6/27/2014 at 5:18 PM, Angelmelody said: why not replace .@F with .F ? nothing change Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted June 27, 2014 On 6/27/2014 at 5:41 PM, dungpt8782 said: On 6/27/2014 at 5:18 PM, Angelmelody said: why not replace .@F with .F ? nothing change this npc work for me prontera,120,125,2 script bla2 120,{ mes "[Test]"; for(set .@i,1; getd(".F"+.@i+"[0]"); set .@i,.@i+1) mes " .F"+.@i+"[0] is exist"; close; OnInit: setarray .F1[0],30712,1,30711,2; setarray .F2[0],30713,1,30712,2; end;}prontera,120,125,2 script bla2 120,{ mes "[Test]"; for(set .@i,1; getd(".F"+.@i+"[0]"); set .@i,.@i+1) mes " .F"+.@i+"[0] is exist"; close; OnInit: setarray .F1[0],30712,1,30711,2; setarray .F2[0],30713,1,30712,2; end;} I think OnInit label can't be trigged by function , you should put it into a npc and use npc var Quote Share this post Link to post Share on other sites
How to make FOR work in case the conditions of the test variables exist?
I made this script and work good with rAthena, but did not work in Hercules
Somebody help me pls!!!!
Share this post
Link to post
Share on other sites