Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
1

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

Asked by 6 days ago
Edited 6 days 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 7955 Badge of Merit Moderation Voter Administrator Community Moderator
5 days ago
Edited 5 days 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 Vitoludde 15 — 5d
0
Accept my answer then plzzzzzzz Goulstem 7955 — 5d
1
The only problem was with the ui, but i fixed it myself. Vitoludde 15 — 5d
Ad

Answer this question