Jump to content

Question

4 answers to this question

Recommended Posts

  • 1
Posted
prontera,155,181,5	script	Random Item	4_F_KAFRA1,{
	
	if ( #COOLDOWN > gettimetick(2) ) {
		mes "Come back again after 24 hours.";
	}
	else {
		if ( rand(100) < 50 ) {
			setarray .@item, 501,502,503,504,505;
			setarray .@amount, 10,20,30,40,50;
			.@index = rand( getarraysize( .@item ) );
			getitem .@item[.@index],.@amount[.@index];
			mes "Gained "+.@amount[.@index]+"x "+getitemname( .@item[.@index] )+".";
		}
		else {
			mes "Failed to get any items.";
		}
		#COOLDOWN = gettimetick(2) + ( 24 * 3600 );
	}
	close;
}

Please clearly describe what you want and how it should work in the first post, and not keep demand for new changes when one already posted a solution prior to your original post request.

 

  • 0
Posted
prontera,155,181,5	script	Random Item	4_F_KAFRA1,{
	
	if ( #COOLDOWN > gettimetick(2) ) {
		mes "Come back again after 24 hours.";
	}
	else {
		if ( rand(100) < 50 ) {
			.@item = F_Rand( 501,502,503,504,505 );
			getitem .@item,1;
			mes "Gained "+getitemname( .@item )+".";
		}
		else {
			mes "Failed to get any items.";
		}
		#COOLDOWN = gettimetick(2) + ( 24 * 3600 );
	}
	close;
}

 

  • 0
Posted (edited)
On 3/11/2017 at 8:18 PM, Emistry said:

prontera,155,181,5	script	Random Item	4_F_KAFRA1,{
	
	if ( #COOLDOWN > gettimetick(2) ) {
		mes "Come back again after 24 hours.";
	}
	else {
		if ( rand(100) < 50 ) {
			.@item = F_Rand( 501,502,503,504,505 );
			getitem .@item,1;
			mes "Gained "+getitemname( .@item )+".";
		}
		else {
			mes "Failed to get any items.";
		}
		#COOLDOWN = gettimetick(2) + ( 24 * 3600 );
	}
	close;
}

 

Edit : Problem. i can't get the item when i click the npc. it should get any item 

How to add reward amount in this script? for example i got 5pcs from 501 item? Thank you Emistry!

Edited by icegrave01
  • -3
Posted
On 3/11/2017 at 2:18 PM, Emistry said:

prontera,155,181,5	script	Random Item	4_F_KAFRA1,{
	
	if ( #COOLDOWN > gettimetick(2) ) {
		mes "Come back again after 24 hours.";
	}
	else {
		if ( rand(100) < 50 ) {
			.@item = F_Rand( 501,502,503,504,505 );
			getitem .@item,1;
			mes "Gained "+getitemname( .@item )+".";
		}
		else {
			mes "Failed to get any items.";
		}
		#COOLDOWN = gettimetick(2) + ( 24 * 3600 );
	}
	close;
}

 

Can you make it a prize each IP
Only 1 acc from ip

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