Welding a player to another player

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    As the screenshot shows, the player who is carrying another player tilts after they are welded together. I want the player who is carrying to not tilt while carrying

  2. What is the issue? Include screenshots / videos if possible!
    image

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I looked for solutions, changing the player’s physical state, welding the part to humanoidrootpart instead of left arm

I uses 2 parts to confirm the place of welding, 1 is welded to the HumanoidRootPart, 1 is constrainted with it and its position is at the left shoulder. Player will be welded to the second part using weld constraint.

this is the code block that manages the carrying process

DownSystem.OnServerEvent:Connect(function(plr : Player, ins : string, v1, v2)
	if ins == "CarryPlayer" then
		local Carried_PlayerCharacter = v1
		local Downed = Carried_PlayerCharacter:FindFirstChild("Downed")
		if Downed and Downed.Value then
			local anim = plr.Character:WaitForChild("Humanoid"):LoadAnimation(game.ReplicatedStorage.Anims.player.Downed.Carrying)
			anim:Play()
			local model = script.CarryPlayerParts.Model:Clone()
			local locklefthandpart = model.LockLeftHandPart
			local shoulderpart = model.ShoulderPart
			locklefthandpart.Parent = plr.Character
			shoulderpart.Parent = plr.Character
			locklefthandpart.CFrame = plr.Character.HumanoidRootPart.CFrame
			locklefthandpart.Toggle.Part0 = plr.Character.HumanoidRootPart
			model:Destroy()
			local PlayerWeld = Instance.new("WeldConstraint",plr.Character)
			Carried_PlayerCharacter.HumanoidRootPart.CFrame = shoulderpart.CFrame
			PlayerWeld.Part0 = plr.Character:WaitForChild("HumanoidRootPart")
			PlayerWeld.Part1 = Carried_PlayerCharacter:WaitForChild("HumanoidRootPart")
			Carried_PlayerCharacter.Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
			--Carried_PlayerCharacter:WaitForChild("RagdollTrigger").Value = true
			for _,Part in pairs(Carried_PlayerCharacter:GetChildren()) do
				if Part:IsA("Part") or Part:IsA("MeshPart") then
					print(Part.Name)
					Part.CanCollide = false
					Part.CanQuery = false
					Part.CanTouch = false
					Part.Massless = true
					Part:SetNetworkOwner(plr)
				end
			end
			DownSystem:FireClient(plr,"Carrying",v1)
		end
	end
end)

This code so unreadable I can’t even help you

2 Likes

i made just this with like 10 - 15 lines of code, why so many unnecessary things?

Try setting the carried guy to platformstand to true

4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.