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

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

Asked by 5 years ago

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.

0
Use a local script. CaptainD_veloper 290 — 5y
0
Please use a Code Block. xXTouchOfFrostXx 125 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

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)
0
should i put the local script under the text button diamondwolf3003 -25 — 5y
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 tonyv537 95 — 5y
0
it didnt work diamondwolf3003 -25 — 5y
Ad

Answer this question