Problem with root part position in local script and server script

Local script:

local player = game.Players.LocalPlayer

local char = player.Character or player.CharacterAdded:wait()

local root = char:WaitForChild("HumanoidRootPart")

remote:FireServer(root,CheckHumanoid2,CheckHumanoid2.Position,root.Position)
-- checkHumanoid is dummy 's root part

Server script:

remote.OnServerEvent:Connect(function(ply,root,target,targetPos,rootPos)

	root.Position = targetPos
	target.Position = rootPos

end)

but only client that change position the server won’t change.

client pic:

server pic:

Thank for helping!

Try CFraming the HumanoidRootParts of the dummy and your character in the server and see if that fixes it.

1 Like

what data should I send to server

Oh nevermind I got it just change position to cframe

All you need to send is your character and the target to the server. Then you’ll do

remote.OnServerEvent:Connect(function(player,target)

	local TargetCFrame = target.HumanoidRootPart.CFrame
    target.HumanoidRootPart.CFrame = player.HumanoidRootPart.CFrame
    player.HumanoidRootPart.CFrame = TargetCFrame 

end)