Claverbot
|
  |
| Joined: 01 Jul 2014 |
| Total Posts: 73 |
|
|
| 27 Mar 2015 02:23 PM |
i wanted to make open and close gui,but i cant open it!heres script:
OpenMe = script.Parent.OpenMe Button = script.Parent.ButtonHere Open = false
Button.MouseButton1Down:connect(function(click) if (Open == false) then Button.Text = "Close" OpenMe.Visible = true Open = true elseif (Open == true) then Button.Text = "Open" OpenMe.Visible = false Open = false end end)
where did i get it wrong? |
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 27 Mar 2015 02:30 PM |
See the line where it says "Button.MouseButton1Down:connect(function(click)?" Replace that with
function onButtonClicked()
and add this at the end of your script:
script.Parent.MouseButton1Click:connect(onButtonClicked) --Modify depending on where the script is. |
|
|
| Report Abuse |
|
|
Claverbot
|
  |
| Joined: 01 Jul 2014 |
| Total Posts: 73 |
|
|
| 27 Mar 2015 02:52 PM |
| after 1 hour...i made another gui.WORKING GUI.but thx |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 02:54 PM |
klink, no. That has no effect whatsoever. |
|
|
| Report Abuse |
|
|
| |
|
Claverbot
|
  |
| Joined: 01 Jul 2014 |
| Total Posts: 73 |
|
| |
|
|
| 27 Mar 2015 02:57 PM |
the real error with your script,
using an elseif where an else would've worked great.
and change
if (Open == false) then to if not Open then
BTW, this has no effect on the error, it's just a clean-up of your script. |
|
|
| Report Abuse |
|
|
Claverbot
|
  |
| Joined: 01 Jul 2014 |
| Total Posts: 73 |
|
| |
|
|
| 27 Mar 2015 03:46 PM |
OpenMe = script.Parent.OpenMe Button = script.Parent.ButtonHere Open = false
Button.MouseButton1Down:connect(function() Open = not Open if Open then Button.Text = "Close" OpenMe.Visible = false else Button.Text = "Open" OpenMe.Visible = true end end) |
|
|
| Report Abuse |
|
|