Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

My localscript in startergui ruins all my gui's Help?

Asked by 5 years ago
Edited 5 years ago

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

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
5 years ago
Edited 5 years ago

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)
0
Thanks really much! It works :D User#26024 0 — 5y
0
Accept my answer then plzzzzzzz Goulstem 8144 — 5y
1
The only problem was with the ui, but i fixed it myself. User#26024 0 — 5y
Ad

Answer this question