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

Why won't my normal Gui disappear? (This is using a LocalScript).

Asked by 3 years ago

The only thing in the output is "work".

script.Parent.MouseButton1Click:Connect(function()
    print ("work")
    game.StarterGui.ChooseGui.choice1gui.Visible = false
end)

How is this not working?

1 answer

Log in to vote
1
Answered by 3 years ago

Hello, please consider this:

script.Parent.MouseButton1Click:Connect(function()
    print ("work")
    game.Players.LocalPlayer:WaitForChild("PlayerGui"):FindFirstChild("ChooseGui"):FindFirstChild("choice1gui").Visible = false
end)

Based from my experiences, contents of StarterGui are automatically replicated to PlayerGui upon spawning.

Resource that may help: https://developer.roblox.com/en-us/api-reference/class/PlayerGui

0
Thank you, this worked perfectly! nafey200 59 — 3y
Ad

Answer this question