FacesUI is not a valid member of PlayerGui "Players.Invential.PlayerGui" but other one works

image

Animations textbutton APPEARS, but Face textbutton do not appear for no reason???

local AnimUI = script.Parent.Parent.Parent.AnimationUI.Animations

script.Parent.MouseButton1Click:Connect(function()
	if AnimUI.Visible == false then
		AnimUI.Visible = true
	end
end) -- this one works
local FaUI = script.Parent.Parent.Parent.FacesUI.Faces

script.Parent.MouseButton1Click:Connect(function()
	if FaUI.Visible == false then
		FaUI.Visible = true
	end
end) -- this one do not work for no reason???

Can you show me your error output?

image

local localplayer = game.Players.LocalPlayer

local playergui = localplayer:WaitForChild(“PlayerGui”):WaitForChild(“FacesUI”)

script.Parent.MouseButton1Click:Connect(function()
if playergui.Frame.Visible == false then
print(2)
playergui.Frame.Visible = true
else
print(1)
end
end) – this one works

Don’t do it using the above solution, continue doing it in the way you were:

local AnimUI = script:FindFirstAncestor("AnimationUI")
local AnimButton = script:FindFirstAncestor("AnimationUI"):WaitForChild("Animations")

script.Parent.MouseButton1Click:Connect(function()
	if AnimUI.Enabled == false then
		AnimUI.Enabled = true
	end
	if AnimButton == true then
		AnimButton.Visible = true
	end
end)

local FaUI = script:FindFirstAncestor("FacesUI")
local FaceButton = script:FindFirstAncestor("FacesUI"):WaitForChild("Faces")

script.Parent.MouseButton1Click:Connect(function()
	if FaUI.Enabled == false then
		FaUI.Enabled = true
	end
	if FaceButton.Visible == false then
		FaceButton.Visible = true
	end
end)

You were likely just forgetting to make both the ScreenGui instance enabled & the TextButton instance visible. Check the properties of all 4 make sure you have them enabled/visible or disabled/invisible from the get-go depending on what you want.