I want this script to go through the player backpack and destroy certain items, but leave the others. Right now, it iterates through the backpack, checks the child's name, prints the name... and then destroys it, regardless of whether that name is in the list of children that I want destroyed. What am I missing?
local backpack = player.Backpack
local children = backpack:GetChildren()
for i = 1, # children do
local child = children[i]
if child.Name == "Chainsaw" or "ChainsawCheck" or "Claws" or "ClawsCheck" or "Container2Check" or "Container3Check"
or "Container4Check" or "Container5Check" or "Container6Check" or "Container7Check" or "Container8Check"
or "Container9Check" or "DozerCheck" or "FireAxe" or "FireAxeCheck" or "Flamethrower" or "FlamethrowerCheck"
or "Grenade" or "GrenadeCheck" or "Halberd" or "HalberdCheck" or "Hammer" or "HammerCheck" or "Jackhammer"
or "JackhammerCheck" or "KatCheck" or "Lucy" or "LucyCheck" or "Machete" or "MacheteCheck" or "RollerCheck"
or "Saw" or "SawCheck" or "SledgeHammer" or "SledgeHammerCheck" or "SuperSaw" or "SuperSawCheck"
then
print(child.Name)
child:Destroy()
else
end
end

2 comments
What's the point of check?
This is just a small bit of the script, all of the checks such as "ChainsawCheck" are there to keep track of whether the player has ever purchased the item from the store before so that the store knows they just need a fresh copy of the tool instead of needing to pay for it again.