So if a player equips a pet and i have the old table of equipped pets and the new table of equipped pets how would i return only the differences between both those tables of equipped pets?
for i, v in pairs(firsttable) do
for a, b in pairs(secondtable) do
if v == b then
table.insert(thridtable, v)
table.insert(thirdtable, b)
end
end
end
for i, v in pairs(thirdtable) do
for a, b in pairs(firsttable) do
for c, d in pairs(secondtable) do
if v ~= b and v ~= d then
table.insert(fourthtable, b)
table.insert(fourthtable, d)
end
end
end
end
the fourth table should have the difference. and the third table should have the pets that are the same
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.