-- Functions

function Default()
	Avatar = nil
	Hold = nil
end

function SearchTable(Item, List)
	for i, s in pairs(List) do
		if (s == Item) then return true end
	end
	return false
end

function MorphHead(Part)
	-- Sub Morph (1/2): Remove Player Customizations
	for i, s in pairs(Part:GetChildren()) do
		if (SearchTable(s.ClassName, AvatarHead) == true) then
			s:Remove()
		end
	end
	wait(1)

	-- Sub Morph (2/2): Add Items To Head
	for i, s in pairs(Head:GetChildren()) do
		if (SearchTable(s.ClassName, AvatarHead) == true) then
			s:Clone().Parent = Part
		end
	end
end

function MorphPlayer(Avatar)
	-- Morph (1/2): Remove Player Customizations & Morph Head
	for i, s in pairs(Avatar:GetChildren()) do
		if (SearchTable(s.ClassName, AvatarBody) == true) and (SearchTable(s.ClassName, ExcludedClasses) == false) and (SearchTable(s.Name, ExcludedNames) == false) or (s.ClassName == "Hat") then
			s:Remove()
		end
		if (s.ClassName == "Part") and (s.Name == "Head") then MorphHead(s) end
	end
	wait(1)

	-- Morph (2/2): Add Items To Avatar
	for i, s in pairs(StealthLava.Parent:GetChildren()) do
		if (SearchTable(s.ClassName, AvatarBody) == true) and (SearchTable(s.ClassName, ExcludedClasses) == false) and (SearchTable(s.Name, ExcludedNames) == false) then
			s:Clone().Parent = Avatar
		end
	end
	wait(1)
end
