'If .... Then .....' Issue

Hi everyone, so I have this code:

if Players.LocalPlayer.PlayerGui.TopbarPlus.TopbarContainer.UnnamedIcon then
   Players.LocalPlayer.PlayerGui.TopbarPlus.TopbarContainer.UnnamedIcon:Destroy()
end

But it always seems to error:

UnnamedIcon is not a valid member of Frame "Players.SimplyEtxan.PlayerGui.TopbarPlus.TopbarContainer"

Does anyone have any ideas?

Try using WaitForChild() or FindFirstChild().

1 Like

Hey, you responded pretty quickly aha. I resolved my issue this morning but my post had to go through approval all day. Sorry about that.

1 Like