So I'm trying to remove the part that matches the names in the table "items" but it just removes my head??
local items = {"Slab","Plate","Wall","CornerWall"} local person = script.Parent.Parent.Character:GetChildren() function mainmod:RemoveItems() for i, v in pairs (person) do if v.Name == items[1] or items[2] or items[3] or items[4] then v.Parent = script.Parent.Refrences print(v.Name.."Removed") break end end end
I believe this should fix it:
local items = {"Slab","Plate","Wall","CornerWall"} local person = script.Parent.Parent.Character:GetChildren() function mainmod:RemoveItems() for i, v in pairs (person) do if v.Name == items[1] or v.Name == items[2] or v.Name == items[3] or v.Name == items[4] then v.Parent = script.Parent.Refrences print(v.Name.."Removed") break end end end