NetworkOwner resetting automatically after anchored then unanchored

I have a few NPCs that has to have its Network owner set to the server. However, every time the NPC goes through a system of anchoring, repositioning then unanchoring, or sometimes even the client anchoring it, repositions, then unanchoring it, the network owner is reset to one of the players. How can I disable it without the need of having to use a loop to change the network owner?

1 Like

cant you just set its network ownership to nil right after unanchoring?

1 Like
local NPC = script.Parent --location here

for i,v in pairs(NPC:GetDescendants()) do
if v:IsA("BasePart") then
v:GetPropertyChangedSignal("Anchored"):Connect(function()
v:SetNetworkOwner(nil)
end)
end
end

some of this may be incorrect due to me typing this in the forum and not studio

Here is simple idea:

SetNetworkOwner of your NPC’s PrimaryPart to nil

like this:
Also you need to have PrimaryPart in NPC

NPC.PrimaryPart:SetNetworkOwner(nil)