Jump to content
  • 0
Sign in to follow this  
ToiletMaster

Can't seem to find all items in inventory

Question

Hi guys, currently i have this script

 

 

       	 mes ""+.npc_name$+"";            mes "Hi There! How's it going? You got any extra items you'd like to exchange?";            next;            mes ""+.npc_name$+"";            mes "If you'd like to trade all your items, please type in 0 when prompted!";                        next;            switch(select("Empty Bottles for Novice Potion:Jellopy for Novice Potion")){                            case 1:                mes ""+.npc_name$+"";                mes "So you got extra bottles eh? For each empty bottle you provide, I'll give you 1 Novice Potion.";                next;                mes ""+.npc_name$+"";                mes "So how many Novice Potions will you be needing today?";                next;                while(input(.@novice,0)){  // minimum 0, max how many also can, unless specified                                        mes ""+.npc_name$+"";                    mes "Please re-think about your choice. It's not making any sense!";                    close;                                        }                mes ""+.npc_name$+"";                mes "So.. you'll be exchanging a total amount of ^FF0000"+.@novice+"^000000 Empty bottles right?";                next;                if(countitem(713) >= .@novice){                                    mes ""+.npc_name$+"";                    mes "Here you go!";                    delitem 713,.@novice;                    getitem 569,.@novice;                    next;                    mes ""+.npc_name$+"";                    mes "Come back if you have more!";                    close;                    }                mes ""+.npc_name$+"";                mes "Please check your inventory, you don't have the requirements to do the exchange!";                close;                                case 2:                mes ""+.npc_name$+"";                mes "So you got extra Jellopies eh? For every two Jellopy you provide, I'll give you 1 Novice Potion.";                next;                mes ""+.npc_name$+"";                mes "So how many Novice Potions will you be needing today?";                next;                while(input(.@potion,1))                    {                                    mes ""+.npc_name$+"";                    mes "Please re-think about your choice. It's not making any sense!";                    close;                                        }                mes ""+.npc_name$+"";                mes "So.. you'll be exchanging a total amount of ^FF0000"+.@potion+"^000000 Novice Potions right?";                next;                if(countitem(909) >= .@potion*2){                                    mes ""+.npc_name$+"";                    mes "Here you go!";                    delitem 909,.@potion*2;                    getitem 569,.@potion;                    next;                    mes ""+.npc_name$+"";                    mes "Come back if you have more!";                    close;                    }                mes ""+.npc_name$+"";                mes "Please check your inventory, you don't have the requirements to do the exchange!";                close;                            }  

 

This is currently working great, but I do have one problem, I wanna make that upon putting in the number 0, the script would find all the items inside, example all empty bottles and tells them that they have 23 (or whatever amount they have) and whether they want to change all of it or not.

 

I did something like this. right after the input,

 

 

              	                                   if(.@novice == 0){                countitem(713) == .@novice;                                mes "You currently have "+.@novice+" in hand. Is that correct?";                close;                                    } 

 

but it doesn't seem to even go to this point. I would appreciate if someone could help me out here as it always skip this part even though i inputted 0.

Edited by ToiletMaster

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

hey guys, this has been solve. i did 2 things wrong on this part.


1stly, the placement of the script i place within the while part, which causes it not to trigger, next i changed my statement to this. Cheers! Hopefully this helps someone

 

 

               	 }                if(.@novice == 0){                set .@amountRP,countitem(713);  //must place set in order to count the item!                mes "You currently have "+.@amountRP+" Empty Bottle in hand. Is that correct?";                close;                                    }   

Share this post


Link to post
Share on other sites
  • 0

or just use:

 

 

.@novice = countitem(713);

 

instead of:

 

countitem(713) == .@novice;

 

:P

the first one sets a variable (=), while the second one compare it (==)

Share this post


Link to post
Share on other sites
  • 0

or just use:

 

 

.@novice = countitem(713);

 

instead of:

 

countitem(713) == .@novice;

 

:P

the first one sets a variable (=), while the second one compare it (==)

 

Thanks for the advice! I'll keep it in mind next time :D

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.