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
 

Basic Gui Open/Close

Previous Thread :: Next Thread 
PredationX is not online. PredationX
Joined: 09 Sep 2012
Total Posts: 1594
28 Mar 2013 06:35 PM
Here's the script:

function onButtonClicked()
if script.Parent.Parent.Label2.Visibility == true
then script.Parent.Parent.Label2.Visibility == false
else
script.Parent.Parent.Label2.Visibility == true
end
if script.Parent.Parent.Label3.Visibility == true
then
script.Parent.Parent.Label3.Visibility == false
else
script.Parent.Parent.Label3.Visibility == true
end
end
script.Parent.MouseButton1Down:connect(Click)

I just began scripting, so I'm not very good at it. This script is in a gui button which is in a gui.. Also in the gui are the buttons Label2, and Label 3. When the main Label is clicked, the others either appear or disappear. This script isn't working.

Output: Players.Player1.PlayerGui.Holo.Label.Script:3: '=' expected near '=='

Any help?
Report Abuse
PredationX is not online. PredationX
Joined: 09 Sep 2012
Total Posts: 1594
28 Mar 2013 06:35 PM
Bump :O
Report Abuse
PredationX is not online. PredationX
Joined: 09 Sep 2012
Total Posts: 1594
28 Mar 2013 06:36 PM
Halp!
Report Abuse
PredationX is not online. PredationX
Joined: 09 Sep 2012
Total Posts: 1594
28 Mar 2013 06:36 PM
Any1?
Report Abuse
PredationX is not online. PredationX
Joined: 09 Sep 2012
Total Posts: 1594
28 Mar 2013 06:37 PM
I reply to my own posts too much. :/
Report Abuse
PredationX is not online. PredationX
Joined: 09 Sep 2012
Total Posts: 1594
28 Mar 2013 06:38 PM
Yawn*
Report Abuse
FIRECAKE is not online. FIRECAKE
Joined: 28 Feb 2009
Total Posts: 25167
28 Mar 2013 06:38 PM
I will assume this is inside a TextButton

script.Parent.MouseButton1Down:connect(function()
if script.Parent.Parent.Label2.Visibility = true then
script.Parent.Parent.Label2.Visibility = false
else
script.Parent.Parent.Label2.Visibility = true
end
if script.Parent.Parent.Label3.Visibility = true
then
script.Parent.Parent.Label3.Visibility = false
else
script.Parent.Parent.Label3.Visibility = true
end
end)

⊂=-҉Ξ҉-=⊃ Verb conjugator, plus herb inhalator ⊂=-҉Ξ҉-=⊃
Report Abuse
PredationX is not online. PredationX
Joined: 09 Sep 2012
Total Posts: 1594
28 Mar 2013 06:40 PM
^ It doesn't work. I'll publish the model so you guys can look at it.
Report Abuse
FIRECAKE is not online. FIRECAKE
Joined: 28 Feb 2009
Total Posts: 25167
28 Mar 2013 06:41 PM
oh well

you are using a property that doesn't exist

the property you want is Visible, not Visibility

⊂=-҉Ξ҉-=⊃ Verb conjugator, plus herb inhalator ⊂=-҉Ξ҉-=⊃
Report Abuse
PredationX is not online. PredationX
Joined: 09 Sep 2012
Total Posts: 1594
28 Mar 2013 06:43 PM
This is it:
http://www.roblox.com/Script-In-Gui-Not-Working-item?id=111000024
Report Abuse
FIRECAKE is not online. FIRECAKE
Joined: 28 Feb 2009
Total Posts: 25167
28 Mar 2013 06:44 PM
try what I suggested mate

still not working i'll take a look at it

⊂=-҉Ξ҉-=⊃ Verb conjugator, plus herb inhalator ⊂=-҉Ξ҉-=⊃
Report Abuse
zack785 is not online. zack785
Joined: 06 Feb 2009
Total Posts: 419
28 Mar 2013 06:55 PM
Dude.. Easy fix... Look at the connection:

you do :connect(Click), now look what you label the function..
Report Abuse
PredationX is not online. PredationX
Joined: 09 Sep 2012
Total Posts: 1594
28 Mar 2013 07:04 PM
Still doesn't work with those fixes.
Output: Players.Player1.PlayerGui.Holo.Label.Script:3: '=' expected near '=='
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
28 Mar 2013 07:06 PM

script.Parent.MouseButton1Down:connect(function()
if script.Parent.Parent.Label2.Visible == true then
script.Parent.Parent.Label2.Visible = false
else
script.Parent.Parent.Label2.Visible = true
end
if script.Parent.Parent.Label3.Visible = true
then
script.Parent.Parent.Label3.Visible = false
else
script.Parent.Parent.Label3.Visible = true
end
end)
Report Abuse
zack785 is not online. zack785
Joined: 06 Feb 2009
Total Posts: 419
28 Mar 2013 07:08 PM
Ah yes, nice catch masterblokz, didn't notice for some reason.
Report Abuse
FIRECAKE is not online. FIRECAKE
Joined: 28 Feb 2009
Total Posts: 25167
28 Mar 2013 07:08 PM
Ah yes, forgot the == for the if/then

⊂=-҉Ξ҉-=⊃ Verb conjugator, plus herb inhalator ⊂=-҉Ξ҉-=⊃
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
28 Mar 2013 07:09 PM
:3
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