Eldoron
|
  |
| Joined: 03 Jan 2010 |
| Total Posts: 19 |
|
|
| 14 Jun 2015 11:52 AM |
Box = script.Parent.Box Button = script.Parent.OpenAndClose Open = false
Button.MouseButton1Down:connect(function(click) if (Open == false) then Button.Text = "Okay" Box.Visible = true Open = true elseif (Open == true) then Button.Text = "Open" Box.Visible = false Open = false end end)
A simple open and close gui. It opens just fine in studio test mode, but when I go to actually play it, it doesn't. |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2015 11:57 AM |
Your problem is an infinite loop, this should work.
Box = script.Parent.Box Button = script.Parent.OpenAndClose Open = false
Button.MouseButton1Down:connect(function(click) if (Open == false) then Button.Text = "Okay" Box.Visible = true Open = true elseif (Open == true) then Button.Text = "Open" Box.Visible = false Open = false end wait () end) |
|
|
| Report Abuse |
|
|
Eldoron
|
  |
| Joined: 03 Jan 2010 |
| Total Posts: 19 |
|
| |
|
|
| 14 Jun 2015 12:02 PM |
ATTEMPT #2
Box = script.Parent.Box Button = script.Parent.OpenAndClose Open = false
Button.MouseButton1Down:connect(function(click) if (Open == false) then Button.Text = "Okay" Box.Visible = true Open = true elseif (Open == true) then Button.Text = "Open" Box.Visible = true Open = false end wait () end) |
|
|
| Report Abuse |
|
|
Eldoron
|
  |
| Joined: 03 Jan 2010 |
| Total Posts: 19 |
|
|
| 14 Jun 2015 12:07 PM |
| In studio it doesn't close, and it doesn't open at all when I normally play it. |
|
|
| Report Abuse |
|
|
Eldoron
|
  |
| Joined: 03 Jan 2010 |
| Total Posts: 19 |
|
| |
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 15 Jun 2015 12:17 AM |
local Box = script.Parent:WaitForChild("Box") local Button = script.Parent:WaitForChild("OpenAndClose") local Open = false
Button.MouseButton1Down:connect(function(click) if Open == false then Button.Text = "Okay" Box.Visible = true Open = true elseif Open == true then Button.Text = "Open" Box.Visible = false Open = false end end)
u sicko! |
|
|
| Report Abuse |
|
|
Eldoron
|
  |
| Joined: 03 Jan 2010 |
| Total Posts: 19 |
|
|
| 15 Jun 2015 07:43 AM |
| Ah, thank you! I appreciate it c: |
|
|
| Report Abuse |
|
|