Script help with "Part" functions

My purpose will fall when there are no blocks under the block or beside.

part:GetConnectedParts() will return a table regardless if there are any rigid joints or not so the if statement will evaluate to true, you should check if the length of table is higher than 1 instead:

if #part:GetConnectedParts() > 1 then
    part.Anchored = true
else
    part.Anchored = false
end

this code makes everything “anchored = false” only scripted parts

Would you care to elaborate please, what do you mean everything is falling apart? Are you going through every part in workspace or something in the cencored part of code?

After a while, the block above one block will be destroyed, and it will either fall, even if the block below it connects to the next block. Script available in some parts