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 » Scripters
Home Search
 

Re: On click script isn't working.

Previous Thread :: Next Thread 
Mindmixer is not online. Mindmixer
Joined: 05 Jul 2011
Total Posts: 1878
19 Feb 2017 02:12 PM
I am trying to make this button "minimise" the gui when clicked.

Button = game.Workspace.AdminGui.Main.Minimise
a = game.Workspace.AdminGui.Main
function minimise()
a.BackgroundTransparency = 1
a.Bar.BackgroundTransparency = 1
a.Bar.TextTransparency = 1
a.Minimize.BackgroundTransparency = .5
a.Minimize.TextTransparency = .5
a.TextLabel.BackgroundTransparency = 1
a.TextLabel.TextTransparency = 1
end

Button.MouseButton1Click:connect(minimise)
Report Abuse
DefaultAxis is not online. DefaultAxis
Joined: 27 Jun 2012
Total Posts: 103
19 Feb 2017 02:24 PM
You cannot place a GUI in the Workspace to make it visible.

Report Abuse
Mindmixer is not online. Mindmixer
Joined: 05 Jul 2011
Total Posts: 1878
19 Feb 2017 02:26 PM
Huh? This gui is being cloned from ### ######### #### ### starter gui of specific people (I already scripted that part).
Report Abuse
Mindmixer is not online. Mindmixer
Joined: 05 Jul 2011
Total Posts: 1878
19 Feb 2017 02:28 PM
Ugh I dislike the filter, but at least it blocks out bad words too.

I basically said that it is being cloned and placed into specific people's starter gui's
Report Abuse
DefaultAxis is not online. DefaultAxis
Joined: 27 Jun 2012
Total Posts: 103
19 Feb 2017 02:30 PM
Okay, in that case, I wouldn't access the GUI from the DataModel (game) but from the script itself. You could also set the Visible property of the GUI to false instead of making the background and text invisible.

Report Abuse
Mindmixer is not online. Mindmixer
Joined: 05 Jul 2011
Total Posts: 1878
19 Feb 2017 02:31 PM
I think I figured out why it isn't working, but it still won't work.

When it is cloned, the clone won't be in the workspace. I fixed it, but it still won't work.

Button = game.Workspace.AdminGui.Main.Minimize
a = game.Workspace.AdminGui.Main
function minimize()
a.BackgroundTransparency = 1
a.Bar.BackgroundTransparency = 1
a.Bar.TextTransparency = 1
a.Minimize.BackgroundTransparency = .5
a.Minimize.TextTransparency = .5
a.TextLabel.BackgroundTransparency = 1
a.TextLabel.TextTransparency = 1
end

Button.MouseButton1Click:connect(minimize)
Report Abuse
Exeriousless is not online. Exeriousless
Joined: 13 Nov 2012
Total Posts: 160
19 Feb 2017 02:32 PM
To detect a click on a part you have to use a ClickDetector.
As for guis, it's a property called MouseButton1Click (only for gui Button objects)
Report Abuse
Mindmixer is not online. Mindmixer
Joined: 05 Jul 2011
Total Posts: 1878
19 Feb 2017 02:32 PM
I posted ### last version. Oops Button = ############################## a = script.Parent.Parent.Parent function minimise() a.BackgroundTransparency = 1 a.Bar.BackgroundTransparency = 1 a.Bar.TextTransparency = 1 a.Minimize.BackgroundTransparency = .5 a.Minimize.TextTransparency = .5 ################################## = 1 ############################ = 1 end Button.MouseButton1Click:connect(minimise)
Report Abuse
Mindmixer is not online. Mindmixer
Joined: 05 Jul 2011
Total Posts: 1878
19 Feb 2017 02:33 PM
Button = script.Parent.Parent.TextLabel
a = script.Parent.Parent.Parent
function minimise()
a.BackgroundTransparency = 1
a.Bar.BackgroundTransparency = 1
a.Bar.TextTransparency = 1
a.Minimize.BackgroundTransparency = .5
a.Minimize.TextTransparency = .5
a.TextLabel.BackgroundTransparency = 1
a.TextLabel.TextTransparency = 1
end

Button.MouseButton1Click:connect(minimise)
Report Abuse
Exeriousless is not online. Exeriousless
Joined: 13 Nov 2012
Total Posts: 160
19 Feb 2017 02:34 PM
And as for FE, local scripts can't change properties of objects located on ### server.
Report Abuse
DefaultAxis is not online. DefaultAxis
Joined: 27 Jun 2012
Total Posts: 103
19 Feb 2017 02:34 PM
Try this: Button = script.Parent -- Change to ### ######## ## ### GUI in PlayerGui a = Button.Parent.Main Button.MouseButton1Down:connect(function() a.BackgroundTransparency = 1 a.Bar.BackgroundTransparency = 1 a.Bar.TextTransparency = 1 a.Minimize.BackgroundTransparency = .5 a.Minimize.TextTransparency = .5 ################################## = 1 ############################ = 1 end)
Report Abuse
Mindmixer is not online. Mindmixer
Joined: 05 Jul 2011
Total Posts: 1878
19 Feb 2017 02:35 PM
I put a click detector in but it still won't work. I put it in ### button.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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