Is it possible to use a table of items in an if statement? For example, let's look at this. Suppose I want to keep only the following potions: 203502,203503,203497,203498,203492,203493. How would I do something like this:
Code: Select all
if item:isType("Potions") and item.Id ~= {203502,203503,203497,203498,203492,203493} then
item:delete()
end
Code: Select all
keepItems = {203502,203503,203497,203498,203492,203493}
if item:isType("Potions") then
local dokeep = 0
for i, mypots in pairs(keepItems) do
if item.Id == mypots then
dokeep = dokeep +1
end
end
if dokeep == 0 then
item:delete()
end
end