I want to set an npc’s ownership to the server but every time i playtest the game, client takes ownership after a while. I use this script:
for i,v in pairs(script.Parent:GetDescendants()) do
if v:IsA("BasePart") then
v:SetNetworkOwner(nil)
end
end
script.Parent.HumanoidRootPart:SetNetworkOwner(nil)
but the client still takes ownership. I use MoveTo on the npc so its ownership not changing is important
I think there’s no other solutions other than that. Personally I wouldn’t be taking away network ownership, since character will no longer be smooth for the client. Try avoiding this method at all cost.
Isn’t this a bug? I thought it worked like, once you set network owner to nil it should stay that way until you use something like :SetNetworkOwnershipAuto(). Players can manipulate their position etc. if they have ownership on the npc.
Just checked, it works fine on me. Probably you are welding something to the npc that is not owned by the server AFTER you do that check (your given script). DO NOT use stuff like runservice.heartbeat. Doing once is enough.