I want to make a function that will destroy all of the ItemFrames in my ItemFrameHolder, but I’m getting the error “invalid argument #3 (string expected, got nil)” when I try to call i:Destroy(). Here is my code:
function destroyAllItemFrames()
for v,i in pairs(itemFrameHolder:GetChildren()) do
if i:IsA("Frame") then
i:Destroy()
end
end
end
This has never happened to me before, does anyone know why this is happening? If so, please respond.