[CLOSED] Issue with setting SetNetworkOwner()

I have a problem setting the network owner. For some reason, it wont work for models with Motor6D.

local character = script.Parent

for i,v in ipairs(character:GetDescendants()) do
	if v:IsA("BasePart") and v.Anchored == false then
		local success, errorReason = v:CanSetNetworkOwnership()
		if success then
			v:SetNetworkOwner(nil)
		end
	end
end

There are no welds in my model, only Motor6D’s.

Is the script a server script? Or a LocalScript? SetNetworkOwner() only works in server scripts.

The code is inside a Server Script.