So, I have this script that supposedly changes the transparency of all of the body parts of a npc.

I did add it to the follow script

There is nothing in the output, and it **only changes the transparency of the head / HumanoidRootPart ** Script:

local cool = true -- cool is the cooldown for when the npc can turn invisible

function invis ()
	local p = script.Parent
	for i, v in pairs (p:GetChildren()) do
		if v:isA ("Part") or v:isA ("Union") then
			v.Transparency = 1
			print(v.Name)
		end
	end
end

function invisOpp ()
	local p = script.Parent
	for i, v in pairs (p:GetChildren()) do
		if v:isA ("Part") or v:isA ("Union") then
			if v.Name == "HumanoidRootPart" then
				v.Transparency = 1
			else
				v.Transparency = 0
			end
		end
	end
end



function findNearestTorso(pos)
	local list = game.Workspace:children()
	local torso = nil
	local dist = 25
	local temp = nil
	local human = nil
	local temp2 = nil
	for x = 1, #list do
		temp2 = list[x]
		if (temp2.className == "Model") and (temp2 ~= script.Parent) then
			temp = temp2:findFirstChild("UpperTorso")
			human = temp2:findFirstChild("Humanoid")
			if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
				if (temp.Position - pos).magnitude < dist then
					torso = temp
					dist = (temp.Position - pos).magnitude
				end
			end
		end
	end
	return torso
end
--wait(math.random(0,5)/10)
while true do
	wait(0.5)
	local target = findNearestTorso(script.Parent.UpperTorso.Position)
	if target ~= nil then
		script.Parent.Enemy:MoveTo(target.Position, target)
		if cool == true then 
			invis()
			wait(5)
			invisOpp()
			cool = false
			wait(8)
			cool = true
		end
	end
end