rap Posted July 16, 2015 Share Posted July 16, 2015 (edited) Hi, guys! Im kinda new in scripting. I just want to ask how do i get the value of an item in a player's inventory. ex. I want to get how many apples do I have in my inventory? And use its value in an IF statement? (SOLVED) next question, How do i get the value of an input variable to be used in a getitem command? Edited July 16, 2015 by rap Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted July 16, 2015 Share Posted July 16, 2015 case 4: // Convert Badges mes "[Erundek]"; mes "[So you want to convert your badges to War Badge, huh?]"; next; menu "Bravery Badges to War Badge",bbadge,"Valor Badges to War Badge",vbadge; bbadge: mes "Input the number of badges you want to convert:"; next; input [email protected]; if ([email protected] >= countitem(7828)) { getitem 7773, [email protected]; delitem 7828, [email protected]; mes "Done!"; } else { mes "You have insufficient badges"; } close; vbadge: mes "Input the number of badges you want to convert:"; next; input [email protected]; if ([email protected] >= countitem(7829)) { getitem 7773, [email protected]; delitem 7829, [email protected]; mes "Done!"; } else { mes "You have insufficient badges"; } close; Quote Link to comment Share on other sites More sharing options...
Emistry Posted July 16, 2015 Share Posted July 16, 2015 count amount of item use countitem if ( countitem( 512 ) < 10 ) { // you have less than 10 apples. } get value of input ... input [email protected]; mes "Your input is : "[email protected]; Quote Link to comment Share on other sites More sharing options...
rap Posted July 16, 2015 Author Share Posted July 16, 2015 count amount of item use countitem if ( countitem( 512 ) < 10 ) { // you have less than 10 apples. } get value of input ... input [email protected]; mes "Your input is : "[email protected]; What i mean is if I want to use getitem and i want to use the value from a previous inputted value how do I do it? Can you correct this for me? Thanks in advance! ^^ case 4: // Convert Badges mes "[Erundek]"; mes "[so you want to convert your badges to War Badge, huh?]"; menu "Bravery Badges to War Badge",bbadge,"Valor Badges to War Badge",vbadge; bbadge; mes "Input the number of badges you want to convert:"; input [email protected]; @count1 = countitem(7828); if ([email protected] >= [email protected]) { getitem 7773, [email protected]; @delitem 7828, [email protected];} close; else {mes "You have insufficient badges"; } close; end; vbadge; mes "Input the number of badges you want to convert:"; intput [email protected]; @count1 = countitem(7829); if ([email protected] >= [email protected]) { getitem 7773, [email protected]; @delitem 7829, [email protected];} close; else {mes "You have insufficient badges"; } close; end; Quote Link to comment Share on other sites More sharing options...
Hi, guys! Im kinda new in scripting. I just want to ask how do i get the value of an item in a player's inventory.
ex. I want to get how many apples do I have in my inventory? And use its value in an IF statement? (SOLVED)
next question, How do i get the value of an input variable to be used in a getitem command?
Edited by rapLink to comment
Share on other sites