Jump to content
  • 0

inventory checks


Question

Posted

Hello guys,

 

What line(s) can I use to check if the character has something in inventory when he clicks NPC? I mean the character should not have anything in his inventory/equip before he can talk to NPC. Not weight (because some items have 0 weight) but item(s) in inventory.

 

Thanks.

2 answers to this question

Recommended Posts

Posted

Getinventorylist
to obtain the list of the items the player is currently holding in their inventory.
use

if (@inventorylist_count) {
mes "please drop all of your items first";
close;
}

to check if there is an item in it or not.
this will return 0 if there's no item in it, and a positive integer if is.
 using this statement, it will ask the player to drop the items first, if they have at least 1 item in their inventory.

  • Upvote 1
Posted

Getinventorylist

to obtain the list of the items the player is currently holding in their inventory.

use

if (@inventorylist_count) {
mes "please drop all of your items first";
close;
}

to check if there is an item in it or not.

this will return 0 if there's no item in it, and a positive integer if is.

 using this statement, it will ask the player to drop the items first, if they have at least 1 item in their inventory.

 

 

Awesome its working!

 

Reputation given.

 

Thanks! :)

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