This is the specific part of code that is throwing the error:
for _, obj in pairs(part:GetChildren()) do
if not obj:IsA("Script") and not obj:IsA("Folder") then
obj:Clone().Parent = part
end
end
Whenever I do:
for _, obj in pairs(part:GetChildren()) do
if obj:IsA("Script") then
obj:Clone().Parent = part
end
end
No errors occur.

4 comments
maybe try if not obj.ClassName=="Script"
Just to be clear the, other "part" is a different part. I don't want to reveal my code.
Pretty sure that you shouldn't store things inside of parts. They should be under a model,
check if the object is there