How does this work for my face giver script but my other thing doesn't?

Hello. I just want someone to explain what this script does to make this work that makes this not work.

This is the one that works:

`local decal = script.Parent:FindFirstChild(“Decal”)

script.Parent.Touched:Connect(function(face)
local hum = face.Parent:FindFirstChild(“Humanoid”)
local head = face.Parent:FindFirstChild(“Head”)

if hum then
	local realface = head:FindFirstChild("face")
	realface.Texture = decal.Texture
end

end)`

and this is the one that doesn’t work:

`local decal = script.Parent:FindFirstChild(“Decal”)

script.Parent.Touched:Connect(function(face)
local hum = face.Parent:FindFirstChild(“Humanoid”)
local head = face.Parent:FindFirstChild(“Head”)
local realface = head:FindFirstChild(“face”)

if hum then
	realface.Texture = decal.Texture
end

end)`

Code 1:

local decal = script.Parent:FindFirstChild("Decal")

script.Parent.Touched:Connect(function(face)
    local hum = face.Parent:FindFirstChild("Humanoid")
    local head = face.Parent:FindFirstChild("Head")

    if hum then
	    local realface = head:FindFirstChild("face")
	    realface.Texture = decal.Texture
    end
end)

Code 2:

local decal = script.Parent:FindFirstChild("Decal")

script.Parent.Touched:Connect(function(face)
    local hum = face.Parent:FindFirstChild("Humanoid")
    local head = face.Parent:FindFirstChild("Head")
    local realface = head:FindFirstChild("face")

    if hum then
	    realface.Texture = decal.Texture
    end
end)

Could you try checking for the realface variable as well inside code 2?

I council putting it in LuaU format, example:

local abc = workspace.Part -- Define abc

abc:Destroy() -- Remove abc from the game

But he said the first one works, so I think these are out of order.