Jump to content
  • 0

Help with this script


Question

Posted

quiz_02,154,389,5 script Usable Item 896,{
callshop "USABLE",0;
npcshopattach "USABLE";
end;
OnBuyItem:
 for(set @i,0;@i<=getarraysize(@bought_nameid);set @i,@i+1)
 {
  if(@bought_nameid[@i] == 678 && @bought_quantity[@i] > 3 || !checkweight(678,5))
  {
  dispbottom "You've reached the maximum of 3 Poison Bottles only!";
  end;
  } if(@bought_nameid[@i] == 7135 && @bought_quantity[@i] > 5 || !checkweight(7135,5))
{
dispbottom "You've reached the maximum of 5 Grenade Bottles only!";
end;
} if (@bought_nameid[@i] == 7136 && @bought_quantity[@i] > 5 || !checkweight(7136,5)) {
 {
 dispbottom "You've reached the maximum of 5 Acid Bottles only";
 end;
 }
 }
 }
if (@bought_nameid == 7135 && @bought_quantity > 5) {
if (checkweight(7135,5) == 0) {
dispbottom "You've reached the maximum of 5 Grenade Bottles only!";
} else {
dispbottom "Maximum of 5 Grenade Bottles only!";
}
}
if (@bought_nameid == 7136 && @bought_quantity > 5) {
if (checkweight(7136,5) == 0) {
dispbottom "You've reached the maximum of 5 Acid Bottles only";
} else {
dispbottom "Maximum of 5 Acid Bottles only!";
}
}
if (@bought_nameid != 678 || @bought_nameid != 7135 || @bought_nameid != 7136) {
getitem @bought_nameid[@i], @bought_quantity[@i];
}
}
- shop USABLE -1,501:0,502:0,503:0,504:0,505:0,645:0,656:0,657:0,1065:0,1750:0,1751:0,1752:0,1758:0,1768:0,1769:0,1763:0,1761:0,1759:0,1760:0,715:0,717:0,716:0,525:0,506:0,714:0,678:0,7139:0,7137:0,7270:0,545:0,546:0,547:0,1025:0,7135:0,7136:0

when buying items the npc dont give me the items. please help <3

1 answer to this question

Recommended Posts

Posted
quiz_02,154,389,5 script Usable Item 896,{
callshop "USABLE",0;
npcshopattach "USABLE";
end;
OnBuyItem:
 for(set @i,0;@i<=getarraysize(@bought_nameid);set @i,@i+1)
 {
  if(@bought_nameid[@i] == 678 && @bought_quantity[@i] > 3 || !checkweight(678,5))
  {
  dispbottom "You've reached the maximum of 3 Poison Bottles only!";
  end;
  } if(@bought_nameid[@i] == 7135 && @bought_quantity[@i] > 5 || !checkweight(7135,5))
   {
   dispbottom "You've reached the maximum of 5 Grenade Bottles only!";
   end;
   } if (@bought_nameid[@i] == 7136 && @bought_quantity[@i] > 5 || !checkweight(7136,5)) {
 {
 dispbottom "You've reached the maximum of 5 Acid Bottles only";
 end;
 }
 }
if (@bought_nameid[@i] == 7135 && @bought_quantity[@i] > 5) {
if (checkweight(7135,5) == 0) {
dispbottom "You've reached the maximum of 5 Grenade Bottles only!";
} else {
dispbottom "Maximum of 5 Grenade Bottles only!";
}
}
if (@bought_nameid[@i] == 7136 && @bought_quantity[@i] > 5) {
if (checkweight(7136,5) == 0) {
dispbottom "You've reached the maximum of 5 Acid Bottles only";
} else {
dispbottom "Maximum of 5 Acid Bottles only!";
}
}
if (@bought_nameid[@i] != 678 || @bought_nameid[@i] != 7135 || @bought_nameid[@i] != 7136) {
getitem @bought_nameid[@i], @bought_quantity[@i];
}
}
}

test it

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