I am trying to make a system where you can grab other players, but whenever I try to make the weld, it gets parented to the wrong character’s arm and the Part0 also gets set to the wrong person’s arm even though it is set to the other character
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local hrp = char:WaitForChild("HumanoidRootPart")
local prompt = Instance.new("ProximityPrompt")
prompt.HoldDuration = 1
prompt.ObjectText = char.Name
prompt.ActionText = "Yoink"
prompt.RequiresLineOfSight = false
prompt.Parent = hrp
game:GetService("ReplicatedStorage").Events.PlayerSpawnEvent:FireClient(plr)
prompt.Triggered:Connect(function(plr2)
local char2 = plr.Character or plr2.CharacterAdded:Wait()
local motor = Instance.new("Motor6D")
motor.Parent = char2:WaitForChild("Right Arm")
motor.Part0 = char2:WaitForChild("Right Arm")
motor.Part1 = char:WaitForChild("HumanoidRootPart")
motor.C0 = script.RightGrip.C0
motor.C1 = CFrame.new()
end)
end)
end)