Visible is not a valid member of PlayerGui "Players.vibratingclock.PlayerGui" error

Hi, I am scripting a simple toggle GUI script, but the studio doesn’t recognize the .Visible property. Not sure what’s wrong, here’s the code.

local TextButton = script.Parent
local Frame = script.Parent.Parent

Frame.Visible = false

TextButton.MouseButton1Click:Connect(function()
	if Frame.Visible == false then
		Frame.Visible = true
	else 
		Frame.Visible = false
	end
end)

Could we see the Explorer where everything is Parented to?

Screenshot 2021-03-26 164050

I don’t really see any errors, The parenting might think your asking for it to be visible in a place where visible doesn’t exist.

You wanted to make the ScreenGui visible

Oh I see, you parented the Frame to the Gui lol

Replace that with this:

local Frame = script.Parent.Parent.Frame
1 Like

Who knew it was something so simple…thanks!

1 Like

Frame is ScreenGui, to toggle a ScreenGui you use .Enabled not .Visible

No worries! We all make mistakes whether it being simple or not so you’re completely fine!