Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to make screengui dissappear after clicking a buton?

I have a screengui i want it to dissapear after clicking a textbutton without using destroy() I've tried setting the Enabled to false but it doesnt work through script

Begin = script.Parent --this is the button-- Begin.MouseButton1Up:Connect(function() game.StarterGui.titlescreen.Enabled = false -- this is the screengui-- end)

1 comment

0

maybe change it's parent?

2 answers

✓ Accepted answer

When you start the game, all GUI objects get moved to the client's 'PlayerGui'.

To fix this put a local script inside of the 'Button' and write the following code:


local Begin = script.Parent
Begin.MouseButton1Click:Connect(function()
    Begin.Parent.Enabled = false
end)

If it works, make this the solution.

1 comment

0

i have already written that

i usually use GUI.Visible = false if anyone has a better way

This discussion is preserved as it was. New answers, comments, and votes are closed.