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

how do i make it so when i click a button all of the gui dissapears?

i have tried it. i tried this code Box = script.Parent:WaitForChild("Box") Button = script.Parent:WaitForChild("OpenAndClose") Open = false

Button.MouseButton1Down:connect(function(open) if Open == false then Button.Text = "Close" Box.Visible = true Open = true elseif Open == true then Button.Text = "Open" Box.Visible = false Open = false end end)?

and many otheres but they dont work please elp.

2 comments

0

Use a local script.

0

Please use a Code Block.

1 answer

Make sure this is a local script:

 Box = script.Parent:WaitForChild("Box") 
Button = script.Parent:WaitForChild("OpenAndClose") 
Open = false

Button.MouseButton1Down:connect(function(open) 
if Open == false 
then Button.Text = "Close"
 Box.Visible = true
 Open = true
 elseif Open == true then
 Button.Text = "Open" 
Box.Visible = false 
Open = false
 end 
end)

3 comments

0

should i put the local script under the text button

0

considering he put "button" as script.Parent.WaitForChild, this would mean you put it under the Frame, or whatever is the parent of your button

0

it didnt work

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