fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
|
| 24 Jul 2013 05:10 PM |
print("Close button loaded")
button = script.Parent window = button.Parent bar = window.TopBar display = Script.Parent.Parent --lol
function onClicked(GUI) if display.Visible == true then --Check if it isn't already minimized display.Visible = false --Minimize button.Text = "Minimize" else display.Visible = true --Maximize button.Text = "Maximize" end end script.Parent.MouseButton1Click:connect(onClicked)
Using this yields no results, any idea on how to fix? I have tried local scripts and normal ones. |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 24 Jul 2013 05:14 PM |
The issue is on the following line, and would of errored in the output, so remember to use the output window.
display = Script.Parent.Parent
script not Script. |
|
|
| Report Abuse |
|
|
fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
| |
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 24 Jul 2013 05:32 PM |
| "Didn't work" -> Elaborate? How is it not working, as in what's not happening. Also, you'll have some issues with it making the button invisible along with the window. |
|
|
| Report Abuse |
|
|
Inviting
|
  |
| Joined: 05 Apr 2011 |
| Total Posts: 99 |
|
|
| 24 Jul 2013 05:38 PM |
"script.Parent.MouseButton1Click:connect(onClicked)"
It's not 'MouseButton1Click'. It's 'MouseButton1Down'. |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 24 Jul 2013 05:41 PM |
@Inviting, Both the 'MouseButton1Click' and 'MouseButton1Down' events can be used here, so that's not the issue.
http://wiki.roblox.com/index.php/MouseButton1Click |
|
|
| Report Abuse |
|
|
fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
|
| 24 Jul 2013 09:56 PM |
| The entire GUI starts off as visible. Clicking the button should toggle visibility, but it fails to do so. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2013 11:34 PM |
Is the object a Frame?
If so, you need to enable to Active property for the event to be received as it is false by default for the Frame object. |
|
|
| Report Abuse |
|
|
fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
|
| 25 Jul 2013 12:08 AM |
| Ah, thank you. Let us hope it works. |
|
|
| Report Abuse |
|
|
fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
| |
|
|
| 25 Jul 2013 02:44 PM |
Maybe remove the argument GUI off then maybe it would work. Correct me if I'm wrong. |
|
|
| Report Abuse |
|
|
fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
| |
|
|
| 25 Jul 2013 05:56 PM |
function onClicked(GUI) to just
function onClicked() |
|
|
| Report Abuse |
|
|
fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
| |
|
Java3D
|
  |
| Joined: 29 Jul 2012 |
| Total Posts: 1229 |
|
|
| 25 Jul 2013 10:45 PM |
print("Close button loaded")
button = script.Parent display = button.Parent -- You put Script, Script is nil.
button.MouseButton1Click:connect(function() -- MouseButton1Click gives no arguments display.Visible = not display.Visible -- If the button is in display, wouldn't it disappear with the display frame? button.Text = display.Visible and "Minimize" or "Maximize" end)
|
|
|
| Report Abuse |
|
|
fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
| |
|
Java3D
|
  |
| Joined: 29 Jul 2012 |
| Total Posts: 1229 |
|
| |
|
fallout68
|
  |
| Joined: 26 Sep 2009 |
| Total Posts: 2249 |
|
|
| 27 Jul 2013 11:42 AM |
| If that is your fix, just looking at it. That is obviously not going to work. |
|
|
| Report Abuse |
|
|
Java3D
|
  |
| Joined: 29 Jul 2012 |
| Total Posts: 1229 |
|
|
| 27 Jul 2013 03:16 PM |
| It is the fix, and it will work. I tested it, and I've been programming Lua for over 4 years. |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2013 03:19 PM |
His will work.
He just put out everything you need.. |
|
|
| Report Abuse |
|
|
Java3D
|
  |
| Joined: 29 Jul 2012 |
| Total Posts: 1229 |
|
| |
|
|
| 27 Jul 2013 03:38 PM |
"display = Script.Parent.Parent --lol"
"Script.Parent.Parent"
"Script"
You capitalized script, which is why it said 'script not Script' |
|
|
| Report Abuse |
|
|
|
| 27 Jul 2013 03:44 PM |
| TheMaster, the first comment explained what you just said. Please read before posting. |
|
|
| Report Abuse |
|
|
Vector2D
|
  |
| Joined: 11 May 2013 |
| Total Posts: 195 |
|
|
| 27 Jul 2013 03:44 PM |
@TheMaster99 Did you bother to read anyone else's post? |
|
|
| Report Abuse |
|
|