How Sync Carry System? (SetNetworkOwner Help)

How make this work smooth ?? I was reading about SetNetworkOwner() function but i’m not sure how fix that

Also, works good with npc on server side, only players have this problem

3 Likes

I’m not sure if SetNetworkOwner would work in this case. The player always has ownership over their character. Might be best to just clone the character for the remote player who’s initiating the carry so that it’s smooth on their screen.

Then perhaps you can do something similar for the player being carried.

Somehow i fixed it other day, but i forget to save it, so i’m pretty sure you can, i just didnt undestand what i made

Try either of these:

  1. When the player picks up the other character, loop through every part of the carried character and set the networkowner to the person who’s holding the other player.
  2. Weld the character’s torso to the other character’s arms

Why his arms? and how i do that?aba

:SetNetworkOwner(Player)

player is the carrying one or who is getting carried?

The player who is carrying the other character

	for i, bp in pairs(?????:GetChildren()) do
		if bp:IsA("BasePart") and bp:CanSetNetworkOwnership() then
			bp:SetNetworkOwner(playerCarryingOther)
		end
	end

what put in ??

A Player instance

Ok, let me try that, give me somes minutes

Oh wait I misread that. Make the ??? the character object and the player instance inside the “bp:SetNetworkOwner()”

Same problem didnt worked

local plrCarry = game:GetService("Players"):GetPlayerFromCharacter(script.Parent.Parent.Parent)
	for i, bp in pairs(plrCarry:GetChildren()) do
		if bp:IsA("Part") and bp:CanSetNetworkOwnership() then
			bp:SetNetworkOwner(plr)
		end
	end

Oh, okay let me try that too, some minutes

Nope same problem, it just ignore what network owner is and continue as normal, should i remove this part?

bp:IsA("Part")

Make it bp:IsA("BasePart") because not all character parts are normal bricks.

Nope…I’m doing it right??

Who is the “plr” ? Try debugging to see if the networkOwner is even changing or if it gets to that part of the script.

plr is whos carrying ( player 2)
script.parent.parent.parent is who died ( player 1)

Setting another player’s network owner is working for me. The script I wrote looks something like this:

for _, Object in ipairs(DeadCharacter:GetDescendants()) do
	if Object:IsA("BasePart") and Object:CanSetNetworkOwnership() then
		Object:SetNetworkOwner(nil)
	end
end

Use GetNetworkOwner to see if the network owner is even changing

I used nil just for the test but it should work when setting a player*