Ongoing list for player inventory (pulp)

I have very little coding experience, so I'm having trouble finding a way to make an ongoing list for a player inventory in pulp. What I'm trying to do is when the player opens a menu and selects inventory a list of everything they have picked up is populated as options in the menu. As of right now what I have is something like this:

menu at x,y then

if itemSword == "pickup" then
option "Sword" then
end
if ItemSheild == "pickup" then
option "Shelid" then
end
end

This seems to work alright, but if the player doesn't have the previous item(s) in the list the following item(s) don't populate in the menu. I'm just not exactly sure what to do. Any help is welcome!

you're missing the "end"s for your ifs so they are chaining together

a = 0
menu at 1,1 then
  if itemSword == "pickup" then
    a++
    option "Sword" then
        // do stuff here
    end
  end
  if itemSheild == 'pickup' then
    a++
    option "Shield" then
      // do stuff here
    end
  end
  // do as many as you want
  if a>0 then
    option "(none)" then
      // maybe do nothing
    end
  end
end

I also added the variable "a" that counts how many menu items there are and adds something to the end if there are none. that way you never have an empty menu

1 Like

That's it! Thank you for your help :slight_smile: