I want to make a script that sets NetworkOwner to nil for all parts in workspace but it gives this error: Network Ownership API cannot be called on Anchored parts or parts welded to Anchored parts. So i tried to fix it but it still gives a error. The Code:
function CheckWelds(Part)
local Found = false
for i,v in pairs(Part:GetDescendants()) do
if Found == false then
if v.ClassName == "Weld" then
Found = true
return "Found"
end
end
end
if Found == false then
wait()
return "None"
end
end
for i,v in pairs(workspace:GetDescendants()) do
if v:IsA("BasePart") and not v:IsA("Terrain") then
if v.Anchored == false then
local Welds = CheckWelds(v)
if Welds == "None" then
print("yes")
v:SetNetworkOwner(nil)
end
end
end
end

1 comment
A pcall will stop your script from returning the error, it'll still error inside the pcall, so it still won't work.