Jump to content
  • 0

Question

Posted

Case:

 

I have a custom box

  • Cannot be opened if you are overweight, 40%++
  • Cannot be opened if you have no slot on your inventory(because you can put many pet items and not make you overweight)
  • Will have a message or dispbottom saying that "You need to have space on your inventory to open this box"

 

What to put in the item script?

 

Thanks.

1 answer to this question

Recommended Posts

Posted

Use a function

function 	script	F_openmyboxplease	{
	.@item_id = 601;// id box

	if ( Weight * 100 >= 40 * MaxWeight ) {
		getitem .@item_id, 1;
		dispbottom "you are overweight";
		end;
	}
	getinventorylist;
	if ( @inventorylist_count >= 100 ) {
		getitem .@item_id, 1;
		dispbottom "You need to have space on your inventory to open this box";
		end;
	}
	getitem 501,1;// item gift
	return;
}

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