Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't my minimize text button script minimize anything?

Asked by 6 years ago

I'm trying to make a minimize button that only minimizes the bottom parts and not the top, but my script isn't working...

local Minimized = false
script.Parent.MouseButton1Down:connect(function()
Minimized = true
script.Parent.Parent.OverLine1.Visible = false
script.Parent.Parent.UnderLine1.Visible = false
script.Parent.Parent.OverLine2.Visible = false
script.Parent.Parent.UnderLine2.Visible = false
script.Parent.Parent.Visible = false
script.Parent.Parent.MainBar.Visible = true
script.Parent.Parent.MainBarShadow.Visible = true
end)
if Minimized == true
    and
    script.Parent.MouseButton1Down:connect(function()
script.Parent.Parent.OverLine1.Visible = true
script.Parent.Parent.UnderLine1.Visible = true
script.Parent.Parent.OverLine2.Visible = true
script.Parent.Parent.UnderLine2.Visible = true
script.Parent.Parent.MainBar.Visible = true
script.Parent.Parent.MainBarShadow.Visible = true
Minimized = false

Thanks if you can help, also I'm kind of a noob so please go easy!

1 answer

Log in to vote
0
Answered by
Vulkarin 581 Moderation Voter
6 years ago

Not totally sure what you were going for. This should always turn the MainBar to visible and turn the other gui's to the same as minimized

local minimized = false

script.Parent.MouseButton1Down:Connect(function()
    minimized = not minimized
    script.Parent.Parent.OverLine1.Visible = minimized
    script.Parent.Parent.UnderLine1.Visible = minimized
    script.Parent.Parent.OverLine2.Visible = minimized
    script.Parent.Parent.UnderLine2.Visible = minimized
    script.Parent.Parent.Visible = minimized
    script.Parent.Parent.MainBar.Visible = true
    script.Parent.Parent.MainBarShadow.Visible = true
end)
Ad

Answer this question