sayhisam1
|
  |
| Joined: 25 Nov 2009 |
| Total Posts: 2092 |
|
|
| 29 Jul 2011 10:35 AM |
the button on the gui is supposed to make the gui invisible, except that when i press the button, it says Disconnected event because of exception. can someone help? here is the code.
local button = script.Parent button.MouseButton1Down:connect(function() Script.Parent.Parent.Visible = false end) |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 29 Jul 2011 10:43 AM |
Look:
script.Parent.MouseButton1Click:connect(function() Click() if script.Parent.Parent.Visible == true then script.Parent.Parent.Visible = false else script.Parent.Parent.Visible = true end end) |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 29 Jul 2011 10:43 AM |
| This script triggers when the mouse completes a full click over the button. |
|
|
| Report Abuse |
|
|
sayhisam1
|
  |
| Joined: 25 Nov 2009 |
| Total Posts: 2092 |
|
|
| 29 Jul 2011 10:46 AM |
| ty, but it still has the same output, and it doesnt work. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 29 Jul 2011 10:46 AM |
| It toggles the visibility, because you mightve accidently clicked it and want it back. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
| |
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 29 Jul 2011 10:48 AM |
Wait, i have one that works:
function Click() if script.Parent.Parent.Main.Visible == true then script.Parent.Parent.Main.Visible = false else script.Parent.Parent.Main.Visible = true end end script.Parent.MouseButton1Down:connect(Click)
|
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 29 Jul 2011 10:50 AM |
| From my minimise button in my game GUI. |
|
|
| Report Abuse |
|
|
sayhisam1
|
  |
| Joined: 25 Nov 2009 |
| Total Posts: 2092 |
|
| |
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
| |
|