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

How come this doesn't work?

Asked by 9 years ago

Well, when I test this in Studio the button disappears and the frame doesnt become visible.

script.Parent.MouseButton1Click:connect(function()
    script.Parent.Frame.Visible = true
    script.Parent.Visible = false
end)

1 answer

Log in to vote
0
Answered by
Retroc 35
9 years ago

The problem is when you make script.Parent.Visible = false, you are making the entire thing not visible.

Basically, when you make a Parent.Visible = False, anything in it is also no longer visible.

So you have

script.Parent.MouseButton1Click:connect(function()
    script.Parent.Frame.Visible = true
    script.Parent.Visible = false
end)

But I would do

script.Parent.MouseButton1Click:connect(function()
    script.Parent.Frame.Visible = true
    script.Parent.Active = false
end)

Or something similar. You can expand on this such as also changing the script.Parent.Text (if you are using a text button) to nothing, and making the BackroundTransparency = 1 or so on. When active = false, it means if you click on it, it doesn't do anything. If this doesn't work, please private message me.

Ad

Answer this question