Weld Constraints destroyed after changing the parent of the accessory

Hello, I am trying to set up a system where these parts will go to the location of the parts in this accessory, weld themselves, and then be parented to the player.

Instead what happens it it is parented and the welds are completely destroyed, not parenting to the player at all.

Here is my script

wait(15)

local function makeWeld(part,handle)
	print("welding")
	local weld = Instance.new("WeldConstraint")
	weld.Part0 = part
	weld.Part1 = handle
	weld.Parent = part
end

print("Making saber")

local saberAccessory = game.ReplicatedStorage.Lightsaber
saberAccessory.Parent = workspace

local parts = game.Workspace.parts:GetChildren()

for i = 1,#parts,1 do
	print("loop begin")
	local locate = parts[i]:FindFirstChildWhichIsA("Part")
	print(locate.Name)
	locate.Parent = saberAccessory
	local saberLocate = saberAccessory:FindFirstChild(locate.Name) 
	locate.Position = saberLocate.Position
	makeWeld(locate,saberLocate)
	locate.Anchored = false
	print("loop end")
end

print("parenting")

saberAccessory.Handle.Anchored = false

saberAccessory.Parent = game.Workspace:WaitForChild("epictitanic6g",50)
4 Likes