Character Loses Walkspeed when jumping while detaining another player

So I’m making a detain tool that would make it so I can drag players around but for some reason when I jump while detaining them I loose my walkspeed

This is the server code:

local remote = game.ReplicatedStorage.DetainEvent
remote.OnServerEvent:Connect(function(plr, target)
	if plr.Backpack:FindFirstChild("Detain") or plr.Character:FindFirstChild("Detain") then
		local Target = game.Players:GetPlayerFromCharacter(target)
		local Weld = Instance.new("Weld")
		
		Target.Character.Torso.CFrame = plr.Character.Torso.CFrame * CFrame.new(0,0.2,-5)
		
		Weld.Part0 = plr.Character.Torso
		Weld.Part1 = Target.Character.Torso
		Weld.C0 = plr.Character.Torso.CFrame:Inverse()
		Weld.C1 = Target.Character.Torso.CFrame:Inverse()
		Target.Character.HumanoidRootPart.Massless = true
		Weld.Parent = Target.Character
		
		print(Target)
	end
end)

The detain is still missing some features such as undetain but I need the core detain to work first.

I cannot help you too much because I have no idea but, using an event in this way opens possibilities to exploit it

I recommend that you put a script server directly in your tool