This is pretty simple but right now I’m trying to create a pet system that allows you to create a shiny pet so I have the selection done but now I’m trying to make it where it checks the already selected pets and sees if they all have the same ID if so select if not don’t select.
So far I’ve made it create a table that puts in the pets information UUID then info such as ID then if there’s more than one item in this table go through the table and check if the previous items have the same name but I cant figure out how to do that here’s my current attempt -
local function duplicatesExist(SelectedPet, pet)
for i = 1, #SelectedPet do
local v = SelectedPet[i]
if v.ID == pet then return true
else
end
end
end
if table.getn(module.SelectedPet) == 5 then
else
if table.getn(module.SelectedPet) > 0 then
if duplicatesExist(module.SelectedPet, clone.Name) == true then
print("duplicate found")
table.insert(module.SelectedPet, pet)
clone.Delete.Visible = true
else
print("no duplicates")
end
else
table.insert(module.SelectedPet, pet)
clone.Delete.Visible = true
end
end