|
| 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 |
|
|
| |
|
| |
|
| |
|
|
| 28 Mar 2013 06:37 PM |
| I reply to my own posts too much. :/ |
|
|
| Report Abuse |
|
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 28 Mar 2013 06:43 PM |
This is it: http://www.roblox.com/Script-In-Gui-Not-Working-item?id=111000024 |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
| |
|