Morph Binder Not Working

I’m using this code for a morph creator, which below is a image of where it is and the surrounding objects.

image

local Rig = script.Parent:FindFirstChild("Rig")
local TouchPart = script.Parent:FindFirstChild("TouchPart")

TouchPart.Touched:Connect(function(HitPart)
	if HitPart and game.Players:GetPlayerFromCharacter(HitPart.Parent) and (not HitPart.Parent:FindFirstChild("HasMorph")) then
		for _,Part in pairs(Rig:GetChildren()) do
			if Part:IsA("BasePart") then
				for _,Mesh in pairs(Part:GetChildren()) do
					print("MESH LOL")
					if Mesh:IsA("BasePart") then
						local Clone = Mesh:Clone()
						print("Cloned! "..Clone.Name)
						local NewWeld = Instance.new("Weld")
						NewWeld.Part0 = HitPart.Parent:FindFirstChild(Part.Name)
						NewWeld.Part1 = Clone
						local CFrameMiddle = CFrame.new(Part.Position)
		
						NewWeld.C0 = HitPart.Parent:FindFirstChild(Part.Name).CFrame:inverse()*CFrameMiddle
						NewWeld.C1 = Mesh.CFrame:Inverse()*CFrameMiddle
						NewWeld.Parent = HitPart.Parent:FindFirstChild(Part.Name)
						Clone.Parent = HitPart.Parent:FindFirstChild(Part.Name)
						Clone.Anchored = false
						Clone.CanCollide = false
						print("Parent" .. Clone.Parent.Name)
						--[[local CJ = CFrame.new(g.Middle.Position)
						local C0 = g.Middle.CFrame:inverse()*CJ
						local C1 = C[i].CFrame:inverse()*CJ
						W.C0 = C0
						W.C1 = C1
						W.Parent = g.Middle]]
					end
					
					--[[
									local W = Instance.new("Weld")
				W.Part0 = g.Middle
				W.Part1 = C[i]
				local CJ = CFrame.new(g.Middle.Position)
				local C0 = g.Middle.CFrame:inverse()*CJ
				local C1 = C[i].CFrame:inverse()*CJ
				W.C0 = C0
				W.C1 = C1
				W.Parent = g.Middle
					]]
				end
			end
		end
		
	end
end)

For some reason this code just clones the morphs outfit, and pastes it anchored and no-collide but not bound to the player. Any idea why?

4 Likes