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 6 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 — 6y
0
Please use a Code Block. xXTouchOfFrostXx 125 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago

Make sure this is a local script:

01Box = script.Parent:WaitForChild("Box")
02Button = script.Parent:WaitForChild("OpenAndClose")
03Open = false
04 
05Button.MouseButton1Down:connect(function(open)
06if Open == false
07then Button.Text = "Close"
08 Box.Visible = true
09 Open = true
10 elseif Open == true then
11 Button.Text = "Open"
12Box.Visible = false
13Open = false
14 end
15end)
0
should i put the local script under the text button diamondwolf3003 -25 — 6y
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 — 6y
0
it didnt work diamondwolf3003 -25 — 6y
Ad

Answer this question