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

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

  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.

Loading...

×
×
  • Create New...

Important Information

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