I can't figure out how to make this detain tool work?

hey developers, ive been working on a detain tool for a client recently, but i just can’t figure out how to make the detained player follow behind the ‘detainer’. ive tried eveything from welding to setting the detained humanoidrootpart to 5 studs behind the detainer, it just doesnt work.

im honestly not sure what to do, so i came here to a trusty development source, here are my scripts.

hierarchy:
image

local script:

local tool = script.Parent
local plr = game.Players.LocalPlayer

local event = script.Parent:WaitForChild('Lock')

tool.Equipped:Connect(function(mouse)
	mouse.Button1Down:Connect(function()
		if mouse.Target then
			event:FireServer(mouse.Target)
		end
	end)
end)

server script:

local event = script.Parent:WaitForChild('Lock')

event.OnServerEvent:Connect(function(plr, Target)
	if Target.Name == 'HumanoidRootPart' then
		--dont know what to do next.
		
		--[[
		a:
			local newtar = Target
			local char = plr.Character
			
			local HRP = char.HumanoidRootPart
			
			local w = Instance.new('Weld', newtar)
			w.Part0 = w.Parent
			w.Part1 = HRP
		
		
		b: 
			set the detained hrp 5 studs behind the detainer
		]]
	end
end)

any help, advice or suggestions would be highly appreciated
thanks in advance

Maybe try Tool.Activated rather than MouseButton1Down on line 5 of the local script? I’m not 100% sure this will work, but you might as well give it a whirl.

no it works up until the

if Target.Name == 'HumanoidRootPart' then

         --i just dont know what to put here

end

Perhaps you could use a part and weld it between the first character, then the second person you are trying to detain.

You could use Instance.new("WeldConstraint")

You are going to have to set the Part1 to the first person, then Part2 to the second person.

https://i.gyazo.com/654bd976cb730a689ce49159c0125832.mp4

local event = script.Parent:WaitForChild('Lock')

event.OnServerEvent:Connect(function(plr, Target)
	if Target.Name == 'HumanoidRootPart' then
		local newTar = Target
		local char = plr.Character
		local HRP = char.HumanoidRootPart
		local weld = Instance.new('WeldConstraint', newTar)
		weld.Part0 = newTar
		weld.Part1 = HRP
	end
end)

just does that
and then it just doesnt allow me to move after