Alright, so here's the thing. I wanted to make a GUI that changes "pages". So you can choose a category then it changes to that category.
But, in the beginning everything worked fine with making the first page invisible. Then i added so the "second" page would become visible after you click. But when I click the GUI button in play mode, everything gets invisible excluding the frames.
The script is in a local script inside StarterGUI
script.Parent.MouseButton1Click:Connect(function() script.Parent.Visible = false print("Changed ChangeCategoryMyth to invisible") script.Parent.Parent.ChangeCategoryWIP.Visible = false print("Changed ChangeCategoryWIP to invisible") game.StarterGui.Garry_Gargoyle.Enabled = true print("Changed Garry_Gargoyle.Textbutton to visible") end)
Everything gets printed. But every GUI in ScriptGUI becomes invisible
Note: I am a beginner in scripting with GUI's.
Screenshots: https://imgur.com/gallery/XfuxOnl
You are manipulating the StarterGui
, when you should be manipulating the client's PlayerGui
. Read this to understand more of what I am referring to.
It seems like you should be doing:
--Predefine a variable for ease of readability local ui = script.Parent.Parent.Parent:FindFirstChild("Gary_Gargoyle") script.Parent.MouseButton1Click:Connect(function() script.Parent.Visible = false print("Changed ChangeCategoryMyth to invisible") script.Parent.Parent.ChangeCategoryWIP.Visible = false print("Changed ChangeCategoryWIP to invisible") ui.Enabled = true --Configure predefined variable print("Changed Garry_Gargoyle.Textbutton to visible") end)