Jump to content
  • 0

Incorporating #item in an NPC.


Question

Posted

I'm having trouble with my script.

I want to make it use the charcommand #item.

I want this to be as simple as possible.

Here's my test script.

quiz_01,186,195,4 script zor 802,{

input .plname$;

input .@prize;

input .@prizeqty;

charcommand "#item .plname$ .@prize .@prizeqty";

}

How this NPC might work:

It asks the name, then item number, then quantity of the item. Then when it's all set it uses #item to give the item directly to player inputted in the first inputBox.

But it always says "#item failed. Player not found.

Already tried adding double quotes("<name>") in the input the character name box, but it still says that.

Help. :(

Or a better script that gives items specifically to players at the whim of a GM.

I tried searching for this but all I keep seeing is the one that goddameit made. I like his script but I don't understand how to edit it to fit my needs. :/

2 answers to this question

Recommended Posts

Posted
prontera,155,181,5 script Sample 757,{
if( getgmlevel() > 80 ){
mes "Enter Items ID :";
mes " 0 = Cancel";
do{
 input .@ItemID;
 if( .@ItemID < 1 ) close;
}while( getitemname( .@ItemID ) == "null" );
mes "Enter Amount :";
input .@Amount,1,30000;
mes "Enter Name :";
input .@Name$;
next;
mes "Name : "+.@Name$;
mes "Item : "+getitemname( .@ItemID );
mes "Amount : "+.@Amount;
if( select("Confirm:Cancel") == 1 ){
 if( !attachrid( getcharid(3,.@Name$) ) )
  message strcharinfo(0),"Player not Found.";
 else{
  getitem .@ItemID,.@Amount,getcharid(3,.@Name$);
  message strcharinfo(0),"Item Sent";
  message .@Name$,"You Received item from "+strcharinfo(0);
 }
}
}
close;
}

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