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: gui button not working.

Previous Thread :: Next Thread 
sayhisam1 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
29 Jul 2011 10:48 AM
Whats the output then?
Report Abuse
digpoe is not online. 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 is not online. 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 is not online. sayhisam1
Joined: 25 Nov 2009
Total Posts: 2092
29 Jul 2011 10:54 AM
yay, it works! ty
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
29 Jul 2011 11:16 AM
np.
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