top of page

Get/Check for Item Quantity in Bag

4.9

This script will check that the player has at least the amount of items in temp1 to succeed.

HMA Discord Link 2.png

Credits:

DontJoelMe

IG_Singularity-BB


How To

Replace (item index) and (amount to check for)

Add what you want to happen when the player has the needed number of items in section 1  


  setvar temp0 (item index)
  bufferitem buffer1 0x4000
  setvar temp1 (amount to check for)
  buffernumber buffer2 0x4001
  setvar temp2 999

loop:
  checkitem 0x4000 0x4002
  if.yes.goto <section1>
  subvar 0x4002 1
  if.compare.goto 0x4002 == 0 <section1>
  goto <loop>

section1: 
  buffernumber buffer3 0x4002
  comparevars 0x4002 0x4001
  if1 < <section2>

(insert what you want to happen if the player has enough of the item here)

goto <section3>

section2: 
  msgbox.default <auto>
{
You need [buffer2] [buffer1], but you only have [buffer3]!
}

section3:
  releaseall
  end

Happy Hacking!

 


bottom of page