generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Minimize/Maximize GUI Frame button

Previous Thread :: Next Thread 
fallout68 is not online. 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 is not online. 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 is not online. fallout68
Joined: 26 Sep 2009
Total Posts: 2249
24 Jul 2013 05:20 PM
Didnt work.
Report Abuse
Desperian is not online. 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 is not online. 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 is not online. 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 is not online. 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
orangegreenblue is not online. orangegreenblue
Joined: 04 Sep 2010
Total Posts: 10906
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 is not online. 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 is not online. fallout68
Joined: 26 Sep 2009
Total Posts: 2249
25 Jul 2013 02:31 PM
Didnt work.
Report Abuse
Lamboreborn is not online. Lamboreborn
Joined: 19 Jun 2009
Total Posts: 191
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 is not online. fallout68
Joined: 26 Sep 2009
Total Posts: 2249
25 Jul 2013 03:34 PM
Which argument?
Report Abuse
Lamboreborn is not online. Lamboreborn
Joined: 19 Jun 2009
Total Posts: 191
25 Jul 2013 05:56 PM
function onClicked(GUI) to just

function onClicked()
Report Abuse
fallout68 is not online. fallout68
Joined: 26 Sep 2009
Total Posts: 2249
25 Jul 2013 09:42 PM
Didnt work.
Report Abuse
Java3D is not online. 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 is not online. fallout68
Joined: 26 Sep 2009
Total Posts: 2249
26 Jul 2013 08:18 PM
Huh?
Report Abuse
Java3D is not online. Java3D
Joined: 29 Jul 2012
Total Posts: 1229
27 Jul 2013 07:14 AM
What?
Report Abuse
fallout68 is not online. 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 is not online. 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
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
27 Jul 2013 03:19 PM
His will work.

He just put out everything you need..
Report Abuse
Java3D is not online. Java3D
Joined: 29 Jul 2012
Total Posts: 1229
27 Jul 2013 03:29 PM
You mean pointed out?
Report Abuse
TheMaster99 is not online. TheMaster99
Joined: 02 Aug 2008
Total Posts: 3839
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
noobkiller878 is not online. noobkiller878
Joined: 22 Dec 2008
Total Posts: 1465
27 Jul 2013 03:44 PM
TheMaster, the first comment explained what you just said. Please read before posting.
Report Abuse
Vector2D is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image