How do you move NPCs locally?

I’m trying to move an NPC (Humanoid:MoveTo() and HumanoidRootPart.CFrame = Part.CFrame) on a local script. When I switch to the Server, however, I also see the changes I made locally. Why does this happen? A local script should change things for the client, not for the server.

Changes made to your character from your local scripts are replicated to the server

The client probably has network ownership of the NPC. Any part(s) that the client has network ownership of can be manipulated on said client and replicated to the server. There’s 2 solutions for this:

  1. You can set the network ownership of the NPC to the server. This makes sure that no client has the power to manipulate the position and have it replicated to the server.
  2. You can create a clone of the NPC on the client instead of the server.

Both will work - it just depends on if you need to reference the NPC on the server as well. In that case, the 1st solution would be your best choice. Hope this helps :slightly_smiling_face:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.