I need help to check variable exist !!!

dungpt8782

New member
Messages
63
Points
0
Age
43
Emulator
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
default_sad.png


Somebody help me pls!!!!

 
Last edited by a moderator:
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

 
Last edited by a moderator:
why not replace  .@F  with .F  ?
nothing change
default_sad.png
  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;}
I think  OnInit label can't be trigged by function , you should put it into  a npc  and use  npc var

 
Back
Top