Jump to content
  • 0

Multiple Countitem Problem


Imbecile

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  48
  • Reputation:   1
  • Joined:  04/14/17
  • Last Seen:  

Hello 

So i use this mining script and i want to edit it so you can use two different items with one npc. the item code is 6010 and 6011. But the delitem only work for ID 6010. the item with ID 6011 are not dissapear. Please help me.

 

Here's the script :

 

if(@mining != 0) goto Lstillmine;
if(.mining != 0) goto Lalreadymine;
//mes "Do you want to mine this rock?";
//menu "Proceed",-;
//next;

if(countitem(6010) < 1 && countitem(6011) < 1) goto Lnopick;

set @minechance,rand(1,2); //50% chance to obtain Ore
set @purechance,rand(1,3); //33.33% chance to obtain an ADDITIONAL mithril, which sells higher

set .mining,1;
set @mining,1;
pcblockmove getcharid(3),1;

if(MineLvl == 0) {

    misceffect 102; //Mining level 0 waits 4 seconds before mining
    sleep2 1000;
    misceffect 102;
    sleep2 1000;
    misceffect 102;
    sleep2 1000;
    misceffect 102;
    sleep2 1000;
    set .mining,0;
    set @mining,0;
    pcblockmove getcharid(3),0;

    if(@minechance == 2) {
    misceffect 154;
    set MineExp,MineExp+1;
    if(@purechance == 3) getitem 32489,2;
    else getitem 32489,1;
    goto Lsuccess;
    }
else {
    misceffect 155;
    delitem 6010,1;
    goto Lfail;
    }
}

else if(MineLvl == 1) {

    misceffect 102; //Mining level 1 waits 3 seconds before mining
    sleep2 1000;
    misceffect 102;
    sleep2 1000;
    misceffect 102;
    sleep2 1000;
    set .mining,0;
    set @mining,0;
    pcblockmove getcharid(3),0;

    if(@minechance == 2) {
    misceffect 154;
    set MineExp,MineExp+1;
    if(@purechance == 3) getitem 32489,2;
    else getitem 32489,1;
    goto Lsuccess;
    }
else {
    misceffect 155;
    delitem 6010,1;
    goto Lfail;
    }
}

else if(MineLvl == 2) { //Mining level 2 waits 2 seconds before mining

    misceffect 102;
    sleep2 1000;
    misceffect 102;
    sleep2 1000;
    set .mining,0;
    set @mining,0;
    pcblockmove getcharid(3),0;

    if(@minechance == 2) {
    misceffect 154;
    set MineExp,MineExp+1;
    if(@purechance == 3) getitem 32489,2;
    else getitem 32489,1;
    goto Lsuccess;
    }
else {
    misceffect 155;
    delitem 6010,1;
    goto Lfail;
    }
}

if(MineLvl == 3) {

    misceffect 102; //Mining level 3 waits 1 second before mining
    sleep2 1000;
    set .mining,0;
    set @mining,0;
    pcblockmove getcharid(3),0;


    if(@minechance == 2) {
    misceffect 154;
    set MineExp,MineExp+1;
    if(@purechance == 3) getitem 32489,2;
    else getitem 32489,1;
    goto Lsuccess;
    }
else {
    misceffect 155;
    delitem 6010,1;
    goto Lfail;
    }
}

if(MineLvl == 0) {

    misceffect 102; //Mining level 0 waits 4 seconds before mining
    sleep2 1000;
    misceffect 102;
    sleep2 1000;
    misceffect 102;
    sleep2 1000;
    misceffect 102;
    sleep2 1000;
    set .mining,0;
    set @mining,0;
    pcblockmove getcharid(3),0;

    if(@minechance == 2) {
    misceffect 154;
    set MineExp,MineExp+1;
    if(@purechance == 3) getitem 32489,2;
    else getitem 32489,1;
    goto Lsuccess;
    }
else {
    misceffect 155;
    delitem 6011,1;
    goto Lfail;
    }
}

else if(MineLvl == 1) {

    misceffect 102; //Mining level 1 waits 3 seconds before mining
    sleep2 1000;
    misceffect 102;
    sleep2 1000;
    misceffect 102;
    sleep2 1000;
    set .mining,0;
    set @mining,0;
    pcblockmove getcharid(3),0;

    if(@minechance == 2) {
    misceffect 154;
    set MineExp,MineExp+1;
    if(@purechance == 3) getitem 32489,2;
    else getitem 32489,1;
    goto Lsuccess;
    }
else {
    misceffect 155;
    delitem 6011,1;
    goto Lfail;
    }
}

else if(MineLvl == 2) { //Mining level 2 waits 2 seconds before mining

    misceffect 102;
    sleep2 1000;
    misceffect 102;
    sleep2 1000;
    set .mining,0;
    set @mining,0;
    pcblockmove getcharid(3),0;

    if(@minechance == 2) {
    misceffect 154;
    set MineExp,MineExp+1;
    if(@purechance == 3) getitem 32489,2;
    else getitem 32489,1;
    goto Lsuccess;
    }
else {
    misceffect 155;
    delitem 6011,1;
    goto Lfail;
    }
}

if(MineLvl == 3) {

    misceffect 102; //Mining level 3 waits 1 second before mining
    sleep2 1000;
    set .mining,0;
    set @mining,0;
    pcblockmove getcharid(3),0;


    if(@minechance == 2) {
    misceffect 154;
    set MineExp,MineExp+1;
    if(@purechance == 3) getitem 32489,2;
    else getitem 32489,1;
    goto Lsuccess;
    }
else {
    misceffect 155;
    delitem 6011,1;
    goto Lfail;
    }
}

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1678
  • Reputation:   704
  • Joined:  12/21/14
  • Last Seen:  

can you put all the script not a part and please use blob.png.a4f4c1db50db7b872fb24032fcf28ba8.png this when you put a long script

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1678
  • Reputation:   704
  • Joined:  12/21/14
  • Last Seen:  

and i see if(countitem(6010) < 1 && countitem(6011) < 1) goto Lnopick;

so you want to take one of each item ?

 

as i see you are re typing the script after it end and the script at the first part ask for 6010 then it end so the player wont go to the next part that ask for 6011

 

 

set .mining,1; is a npc variable so when the player talk to the npc any player talk to the same npc the variable would be 1 even if they didn't reach set .mining,1;

Edited by sader1992
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  48
  • Reputation:   1
  • Joined:  04/14/17
  • Last Seen:  

hi @sader1992 . Yes i only re-type the whole script in case that is the problem why the 6011 won't disappear. But i guess i'm wrong. What should i do?

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1678
  • Reputation:   704
  • Joined:  12/21/14
  • Last Seen:  

if you put the whole script here i could edit it for you

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  48
  • Reputation:   1
  • Joined:  04/14/17
  • Last Seen:  

okay. i will send it to you. thanks for your help sir

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