How would I count multiple items in a room using GMCP and do something different depending on if there were one or two (or more) of them?
Currently I have:
for _, v in pairs(gmcp.Char.Items.List.items) do
if v.name == "a monolith sigil" then
info("A monolith is here!")
end
end
If I am in a room with two monoliths, it will send the info message twice. What I would ideally like to do, however, is to have one info message if there is only one monolith sigil in the room (saying 'Get another sigil!') and a second info message if there are two or more monolith sigils in the room (saying 'All safe here!')
Any help or guidance is much appreciated.
Thanks!
GMCP - counting how many of an item in a room
Re: GMCP - counting how many of an item in a room
This should do it for ya: