How to fix my morph

whenever I step on the morph my head falls off! I don’t know why.

chest script :

function onTouched(hit)
if hit.Parent:findFirstChild(“Humanoid”) ~= nil and hit.Parent:findFirstChild(“Chest”) == nil then
local g = script.Parent.Parent.Chest:clone()
g.Parent = hit.Parent
local C = g:GetChildren()
for i=1, #C do
if C[i].className == "UnionOperation"or C[i].className == “Part” then
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
local Y = Instance.new(“Weld”)
Y.Part0 = hit.Parent.Torso
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end

	local h = g:GetChildren()
	for i = 1, # h do
		h[i].Anchored = false
		h[i].CanCollide = false
	end
	
end

end

script.Parent.Touched:connect(onTouched)

face script

– declarations

local head = script.Parent

function onTouched(part)

local h = part.Parent:findFirstChild(“Humanoid”)

if h~=nil then

if part.Parent:findFirstChild(“Head”):findFirstChild(“face”).Texture == nil then return end

part.Parent:findFirstChild(“Head”):findFirstChild(“face”).Texture="717dea9c5a1659640155f77c84892c " end

end

script.Parent.Touched:connect(onTouched)

head scirpt :
function onTouched(hit)
if hit.Parent:findFirstChild(“Humanoid”) ~= nil and hit.Parent:findFirstChild(“Headz”) == nil then
local g = script.Parent.Parent.Headz:clone()
g.Parent = hit.Parent
local C = g:GetChildren()
for i=1, #C do
if C[i].className == “Part” or C[i].className == “UnionOperation” then
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
local Y = Instance.new(“Weld”)
Y.Part0 = hit.Parent.Head
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end

	local h = g:GetChildren()
	for i = 1, # h do
		h[i].Anchored = false
		h[i].CanCollide = false
	end
	
end

end

script.Parent.Touched:connect(onTouched)

legs script :

function onTouched(hit)
if hit.Parent:findFirstChild(“Humanoid”) ~= nil and hit.Parent:findFirstChild(“Leg1”) == nil then
local g = script.Parent.Parent.Leg1:clone()
g.Parent = hit.Parent
local C = g:GetChildren()
for i=1, #C do
if C[i].className == "UnionOperation"or C[i].className ==“Part” then
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
local Y = Instance.new(“Weld”)
Y.Part0 = hit.Parent[“Left Leg”]
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end

	local h = g:GetChildren()
	for i = 1, # h do
		h[i].Anchored = false
		h[i].CanCollide = false
	end
	
end

if hit.Parent:findFirstChild("Humanoid") ~= nil and hit.Parent:findFirstChild("Leg2") == nil then
	local g = script.Parent.Parent.Leg2:clone()
	g.Parent = hit.Parent
	local C = g:GetChildren()
	for i=1, #C do
		if C[i].className == "UnionOperation"or C[i].className =="Part" then
			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
			local Y = Instance.new("Weld")
			Y.Part0 = hit.Parent["Right Leg"]
			Y.Part1 = g.Middle
			Y.C0 = CFrame.new(0, 0, 0)
			Y.Parent = Y.Part0
	end

	local h = g:GetChildren()
	for i = 1, # h do
		h[i].Anchored = false
		h[i].CanCollide = false
	end
	
end

end

script.Parent.Touched:connect(onTouched)

]

and this script that morph u in the thing it changes ur transparency

function onTouch(part)

local human = part.Parent:findFirstChild(“Humanoid”)

if human ~= nil then

part.Parent:findFirstChild(“Head”).Transparency = 1

part.Parent:findFirstChild(“Torso”).Transparency = 1

part.Parent:findFirstChild(“Left Arm”).Transparency = 1

part.Parent:findFirstChild(“Right Arm”).Transparency = 1

part.Parent:findFirstChild(“Left Leg”).CanCollide = true

part.Parent:findFirstChild(“Left Leg”).Transparency = 1

part.Parent:findFirstChild(“Right Leg”).CanCollide = true

part.Parent:findFirstChild(“Right Leg”).Transparency = 1

end

end

script.Parent.Touched:connect(onTouch)

–COLORS

–1 = white

–208 = Light stone grey

–194 = Medium stone grey

–199 = Dark stone grey

–26 = Black

–21 = Bright red

–24 = Bright yellow

–226 = Cool yellow

–23 = Bright blue

–107 = Bright bluish green

–102 = Medium blue

–11 = Pastel blue

–45 = Light blue

–135 = Sand blue

–106 = Bright orange

–105 = Br. yellowish orange

–141 = Earth green

–28 = Dark green

–37 = Bright green

–119 = Br. yellowish green

–29 = Medium green

–151 = Sand green

–38 = Dark orange

–192 = Reddish brown

–104 = Bright violet

–9 = Light reddish violet

–101 = Medium red

–5 = Brick Yellow

–153 = Sand red

–217 = Brown

–18 = Nougat

–125 = Light orange

You have supplied a lot of information but it needs formatting a bit so we can read it.
Would you please surround each of your code segments with ``` (before and after)
Also try and identify using prints where in which script the head falling off event happens.