I set NetworkOwner to all the limbs of an npc,` so the client can’t move it. But whenever I tried moving the npc’s head on the client, it moves on the client. I wonder why. This is very bad, as we can kill the npc even when the server sees us hitting nothing.
Here’s the script.
local dummy = script.Parent:GetChildren()
for i, v in pairs(dummy) do
if v:IsA("BasePart") then
local success, errorReason = v:CanSetNetworkOwnership()
if success then
v:SetNetworkOwner(nil)
else
error(errorReason)
end
end
end
I don’t know why we have to do this, can someone explain it to me? is it like the pcall() function thing? Like I don’t know how it can either return the value for succes or errorReason.
yeah, but how do you prevent the client killing the npc from a far distance? if the npc dies, it replicates to the server. (I’m having doubt with if it will replicate to the server)