Pink Guy Posted February 13, 2013 Group: Members Topic Count: 131 Topics Per Day: 0.03 Content Count: 371 Reputation: 3 Joined: 11/14/11 Last Seen: December 9, 2023 Share 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 Link to comment Share on other sites More sharing options...
Schrwaizer Posted February 13, 2013 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 43 Reputation: 15 Joined: 06/24/12 Last Seen: April 11 Share 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 Link to comment Share on other sites More sharing options...
Emistry Posted February 13, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted February 13, 2013 if( countitem( <itemID> ) < amount ){ atcommand "@load"; } refer countitem , atcommand Quote Link to comment Share on other sites More sharing options...
Pink Guy Posted February 13, 2013 Group: Members Topic Count: 131 Topics Per Day: 0.03 Content Count: 371 Reputation: 3 Joined: 11/14/11 Last Seen: December 9, 2023 Author Share 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 Link to comment Share on other sites More sharing options...
Schrwaizer Posted February 14, 2013 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 43 Reputation: 15 Joined: 06/24/12 Last Seen: April 11 Share 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 Link to comment Share on other sites More sharing options...
Pink Guy Posted February 14, 2013 Group: Members Topic Count: 131 Topics Per Day: 0.03 Content Count: 371 Reputation: 3 Joined: 11/14/11 Last Seen: December 9, 2023 Author Share 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 Link to comment Share on other sites More sharing options...
Schrwaizer Posted February 14, 2013 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 43 Reputation: 15 Joined: 06/24/12 Last Seen: April 11 Share 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 Link to comment Share on other sites More sharing options...
Pink Guy Posted February 14, 2013 Group: Members Topic Count: 131 Topics Per Day: 0.03 Content Count: 371 Reputation: 3 Joined: 11/14/11 Last Seen: December 9, 2023 Author Share Posted February 14, 2013 Thanks Quote Link to comment Share on other sites More sharing options...
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.
Link to comment
Share on other sites
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.