Local Pet Following script replicates in server? (is this a bug?)

local bodyPos = Instance.new("BodyPosition",pet)
	bodyPos.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
	local bodyGyro = Instance.new("BodyGyro",pet)
	bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
	

	while petMdl.Parent ~= nil do
		bodyPos.Position = petOwnerHRP.Position + petSlotPositions[petSlot.Value]
		bodyGyro.CFrame = petOwnerHRP.CFrame
		wait()
	end

so I have a local script here that makes the Pet NPC follow the player but shouldnt this only happen in the player’s perspective? the vid shows that the pet following script also replicate or happens in server

If the pet is replicated to both the client and server (which it appears it is), and the client has Network Ownership over the physics of the pet, then the changes the client makes will replicate to the server.
Even if the body mover’s properties don’t appear to be replicating to the server, the server doesn’t interfere with the pet’s physics because the client is controlling them.

3 Likes

How do I make it so that the client will not take network ownership over the pet?

You can remove a client’s ability to take network ownership of parts by settings the network ownership to nil.
However, this raises the problem that the server now has control over the pet. Everything in that LocalScript will no longer be relevant, as the server now controls the pet.
If I’m not mistaken, I believe you are trying to make the pet local to the player and not replicated to the server. If this is the case, you should only create the pet on the client, which can be accomplished by making a clone of the pet from a LocalScript which won’t replicate to the server.

1 Like

okay ill try that once i get home, il give an update later. thanks

1 Like

problems fixed now, thanks so much for helping me

1 Like

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