Jump to content
  • 0
Lord Ganja

HELP in @item npc script

Question

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 [email protected];
next;
mes "[Item Giver]";
mes "How many pieces of this item do you want to receive?";
input [email protected];
next;
mes "[Item Giver]";
mes "Here you go! Come again!";
getitem [email protected],[email protected];
close;
end;
}

 

 

Edited by Lord Ganja
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

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 [email protected];
if ([email protected] == 0)
    close;
Link to comment
Share on other sites

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 [email protected];
if ([email protected] == 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
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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.