Handcuff tool not putting player in the right position. What could I do?

I’m working on a detain system at the moment. If the player with the handcuffs, cuffs something with a humanoid, it creates a weld, and changes the walkspeed and jumppower to 0 so they can’t move.

I’ve looked slightly around the devforum, and can’t seem to find anything about my problem.
I want it to be directly in front of the torso, but it doesn’t seem to work.

LocalScript in the Tool

local LocalPlayer = game:GetService("Players").LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local Parent = script.Parent
local Cuffed = Parent:WaitForChild("CuffActivated")
local Activated = false

Parent.Equipped:Connect(function()
	Activated = true
end)
Parent.Unequipped:Connect(function()
	Activated = false
end)

Mouse.Button1Down:Connect(function()
	if Mouse.Target.Parent:FindFirstChild("Humanoid") and Activated == true and Cuffed.Value == false then
		local PlayerToCuff = Mouse.Target.Parent
		game.ReplicatedStorage.Cuffed:FireServer(PlayerToCuff)
		print("FiredCuffed")
	else
		print("Fired Uncuff")
		game.ReplicatedStorage.Uncuff:FireServer()
	end
end)

Script in the Tool

local Cuff = game:GetService("ReplicatedStorage").Cuffed
local Uncuff = game:GetService("ReplicatedStorage").Uncuff
local CuffsActivated = script.Parent.CuffActivated.Value

Cuff.OnServerEvent:Connect(function(plr, plrToCuff)
	
	print("Cuffed")
	local plrChar = game.Workspace:FindFirstChild(plr.Name)
	
	CuffsActivated = true
	plrToCuff.HumanoidRootPart.CFrame = CFrame.new(-4,0,0) * plrChar.HumanoidRootPart.CFrame
	
	plrToCuff.Humanoid.WalkSpeed = 0
	plrToCuff.Humanoid.JumpPower = 0
	
	 NewWeld = Instance.new("WeldConstraint")
	 NewWeld.Part0 = plrToCuff.HumanoidRootPart
	 NewWeld.Part1 = plrChar.HumanoidRootPart
	
	 NewWeld.Parent = plrChar
end)

Uncuff.OnServerEvent:Connect(function(plr)
	CuffsActivated = false
	NewWeld:Destroy()
	print("Weld Destroyed")
end)

Try with NewWeld.C0 = plrChar.HumanoidRootPart.CFrame * CFrame.new(0,0,-4) , basically you’re setting the weld’s CFrame instead of the other player’s HRP CFrame. To put the “enemy” in front of the player and not on the side, instead of changing the X axis you should change the Z axis (CFrame.new(X,Y,Z) if you didn’t know). Hope it helped, let me know if it still doesn’t work and we can work out to find a solution. :+1:

2 Likes