Jump to content
  • 0
dungpt8782

I need help to check variable exist !!!

Question

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

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

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

Share this post


Link to post
Share on other sites
  • 0

 

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;}

I think  OnInit label can't be trigged by function , you should put it into  a npc  and use  npc var

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.