Jump to content
  • 0

Item script


realRO

Question


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  84
  • Reputation:   0
  • Joined:  12/24/13
  • Last Seen:  

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.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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;
}
Link to comment
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.   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.

×
×
  • Create New...