Jump to content
  • 0

Help With Script


Question

Posted

Good Night!

 

I create an NPC following this example from another topic

setarray array1[0],987,654,321;

setarray array2[0],123,456,789;

setarray array3[0],987,654,321;

set arraycount,3;

set .@a,1;

L_ArrayLoop:

for(set .@i,0; .@i<getarraysize( getd("array"+.@a+"") ); set .@i,.@i+1)

{set .@menu$, .@menu$ + (.@i?":":"");

	if( getd("array"+.@a+"["+.@i+"]") ) // found

		{set .@menu$, .@menu$ + getd("array"+.@a+"["+.@i+"]");}

}//end for(loop)

set .@a,.@a+1; if( .@a < arraycount ){goto L_ArrayLoop;}

// This will display after it's done with the array loop.

blah blah blah

1 answer to this question

Recommended Posts

Posted

more like this

prontera,155,188,5	script	kjdhfdksjf	100,{
	setarray .@array1$,"123","456","789";
	setarray .@array2$,"abc","def","ghi";
	setarray .@array3$,"rst","uvw","xyz";
	.@s1 = select( "1:2:3" );
	for ( .@i = 0; .@i < 3; .@i++ )
		.@menu$ = .@menu$ + getd( ".@array"+ .@s1 +"$["+ .@i +"]" ) +":";
	.@s2 = select( .@menu$ ) -1;
	mes getd( ".@array"+ .@s1 +"$["+ .@s2 +"]" );
	close;
}
  • Upvote 1

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...