First thing I notice is there might be an issue with the logic of the code.
So for each slot you first do the forcedrop check, issue I see with that code is if the item is deleted it still continues on and does the rest of the code for that item slot even though the item has been deleted.
Next you check the forcekeep table, you check if the item.Name is the same as the item in the first spot of the table but what if it the third name in the table, basically if it isn't the first name then it doesn't get to check the second and onwards becuase of the else.
Ok so in a nutshell
Code: Select all
for k, v in ipairs(forcedrop) do
if v == item.Name then
printf("Deleting Item: "..item.Name.."\n");
item:delete();
end
end
Code: Select all
for j, l in ipairs(forcekeep) do
--printf("force Item: "..l.."\n");
--printf("Item name: "..item.Name.."\n");
if l == item.Name then
--keep it
printf("Keeping Item: "..item.Name.."\n");
else
So to sum up, work out how to break from the checking table if item is deleted and then rethink how you are dealing with the forcekeep table =)