Jump to content
  • 0

HELP in @item npc script


Question

Posted (edited)
Hello, please help me with this. What script should I use in order for the npc to close whenever the input # is '0' or 'null'.
and whenever they input an ITEM ID which is NOT in the database it will say "Invalid Item ID"..
 
Thanks in advance..
 
Here's my script:
prontera,142,172,5    script    Item Giver    106,{
mes "[Item Giver]";
mes "Please input the ITEM NUMBER that you want to receive.";
mes " ";
mes "You could use @ii <item name> to look for it or browse at ratemyserver.net";
input .@itemnum;
next;
mes "[Item Giver]";
mes "How many pieces of this item do you want to receive?";
input .@itemcount;
next;
mes "[Item Giver]";
mes "Here you go! Come again!";
getitem .@itemnum,.@itemcount;
close;
end;
}

 

 

Edited by Lord Ganja

4 answers to this question

Recommended Posts

Posted

Because the variables you are using to store the input values  are integer the input will never be "null"; it's always a number.
To answer your question with an example:

input .@itemnum;
if (.@itemnum == 0)
    close;
Posted (edited)

Because the variables you are using to store the input values  are integer the input will never be "null"; it's always a number.

To answer your question with an example:

input .@itemnum;
if (.@itemnum == 0)
    close;

Thanks for the reply. But how about the item id which is not in the itemdb?

 

EDIT:

 

Nevermind, I already solved it. thanks anyway.

Edited by Lord Ganja

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