Mr.Caffeine
Active Member
- Joined
- Nov 4, 2018
- Messages
- 79
- Reaction score
- 43
Hello, I need this npc script to be able to check and remove items from position.
I can make it work with a single item, but if I add more items to the array it doesn't work. what I want is the npc recognize multiple item ids that can be removed if the item is on the tile. The tile only accepts one item at a time, there is no problem with conflicts and it is not necessary to create an event for this. I just want the npc to recognize more than one item id that can be removed.
I can make it work with a single item, but if I add more items to the array it doesn't work. what I want is the npc recognize multiple item ids that can be removed if the item is on the tile. The tile only accepts one item at a time, there is no problem with conflicts and it is not necessary to create an event for this. I just want the npc to recognize more than one item id that can be removed.
Code:
local config = {
items = {2388,2390,2424,2438,2450,7379,7424,7438,7450,7454,8856,8858,8926,12609,12610,12796,12797,12798,12805,12812,12818}
}
local thing = getTileItemById(pos, config.items).uid
if thing > 0 then
doRemoveItem(thing,1)
selfSay('worked!', cid)
else
selfSay('not worked!', cid)
end