|
| 07 Jul 2017 12:09 PM |
I'm trying to make a script that will toggle my gui and I can get it to hide the guis but not vice versa. The problem is that my int value clicks (script.parent.parent.clicks.value) wont change values. As you can see at the end of Die and Born it is supposed to change values except in practice it is always 0.
if script.Parent.Parent.Clicks.Value == 0 then function die() script.Parent.Parent.Visible.Visible = false script.Parent.Parent.CamFix.Visible = false script.Parent.Parent.TextButton.Visible = false script.Parent.Parent.Clicks.Value = 1 wait() end end
script.Parent.MouseButton1Down:connect(die)
if script.Parent.Parent.Clicks.Value == 1 then function born() script.Parent.Parent.Visible.Visible = true script.Parent.Parent.CamFix.Visible = true script.Parent.Parent.TextButton.Visible = true script.Parent.Parent.Clicks.Value = 0 wait() end end
script.Parent.MouseButton1Down:connect(born)
|
|
|
| Report Abuse |
|
|
|
| 07 Jul 2017 12:10 PM |
wat
your if statements are outside the functions. wat.
... wat. |
|
|
| Report Abuse |
|
|
Thedagz
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 798 |
|
| |
|
|
| 07 Jul 2017 12:12 PM |
| That was a copy pasting error, still doesnt work. |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2017 12:15 PM |
you ... wat... repaste the code pls |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2017 12:15 PM |
fixed it, locking the post now! Thanks
function die() if script.Parent.Parent.Clicks.Value == 0 then script.Parent.Parent.Visible.Visible = false script.Parent.Parent.CamFix.Visible = false script.Parent.Parent.TextButton.Visible = false script.Parent.Parent.Clicks.Value = 1 wait() elseif script.Parent.Parent.Clicks.Value == 1 then script.Parent.Parent.Visible.Visible = true script.Parent.Parent.CamFix.Visible = true script.Parent.Parent.TextButton.Visible = true script.Parent.Parent.Clicks.Value = 0 wait() end end
script.Parent.MouseButton1Down:connect(die) |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2017 12:16 PM |
| you can't lock the post haha |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Jul 2017 12:18 PM |
You probably won't look at this post again but you could do this instead. But this would require leParent.Clicks to be a BoolValue instead of an IntValue
function die() local leParent = script.Parent.Parent leParent.Visible.Visible = not leParent.Visible.Visible leParent.CamFix.Visible = not leParent.CameFix.Visible leParent.TextButton.Visible = not leParent.TextButton.Visible leParent.Clicks.Value = leParent.Clicks.Value wait() end |
|
|
| Report Abuse |
|
|
| |
|