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?
Ok6c
(Ok6c)
#4
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.
ShyFlooo
(Flo)
#5
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!