Pink Guy Posted February 13, 2013 Posted February 13, 2013 I just want the script command/s that checks if you have a certain item and then @loads you if you don't have that item. For example, #7227. I just want to include this to my upcoming script so if you can help, it would be a big help to me. Quote
Schrwaizer Posted February 13, 2013 Posted February 13, 2013 (edited) common npc header,{ set .@your_item_id, <here>; set .@your_item_qt, <here>; if(!countitem(.@your_item_id)) { getitem .@your_item_id, .@your_item_qt; } end; } This will work, but if the player stores the item, it can get more. If you want to change this, tell me. Edited February 13, 2013 by Schrwaizer Quote
Emistry Posted February 13, 2013 Posted February 13, 2013 if( countitem( <itemID> ) < amount ){ atcommand "@load"; } refer countitem , atcommand Quote
Pink Guy Posted February 13, 2013 Author Posted February 13, 2013 Thank you Emistry and Schrwaizer. Btw, what do you mean by store? I just want them to have it in the inventory, if they have it on storage, they will be @load-ed they just have to have it with them in their inventory. Quote
Schrwaizer Posted February 14, 2013 Posted February 14, 2013 (edited) Ooh, I just had misunderstanding... just replace the getitem command to warp command, like this: common npc header,{ set .@your_item_id, <here>; if(!countitem(.@your_item_id)) { warp "Save",0,0; } end; } Edited February 14, 2013 by Schrwaizer Quote
Pink Guy Posted February 14, 2013 Author Posted February 14, 2013 What does the "common npc header,{" does? Can I just remove it or?? anyway.. here's my example from the syntax you gave. set .@your_item_id, 7227; if(!countitem(.@your_item_id)) { warp "Save",0,0; } end; } Also, I want to put the function to a certain map.. let's say prontera.. Quote
Schrwaizer Posted February 14, 2013 Posted February 14, 2013 If you want it to be triggered when the player log in a map, use this: - /tab/ script /tab/ item_checker /tab/ -1,{ OnPcLoadMapEvent: if(strcharinfo(3) == "prontera" && countitem(7227) ) { warp "Save",0,0; } end; } prontera /tab/ mapflag /tab/ loadevent You can just replace "common npc header" with your npc header, it has anything special on it. Also, if you will still use the previous script, remove the "!" before "countitem"... it shouldn't be there. Ask me if it don't work. Quote
Question
Pink Guy
I just want the script command/s that checks if you have a certain item and then @loads you if you don't have that item. For example, #7227.
I just want to include this to my upcoming script so if you can help, it would be a big help to me.
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.