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

Why does my credit menu screen script not work I did everything right though?

Asked by 5 years ago
Credit = script.Parent.Credit
Frame = script.Parent.Frame
TextLabel = Frame.TextLabel

Credit.MouseButton1Click:Connect(function()
    if Credit.Visible == true and Frame.Visible == false then
        Frame.Visible = true
        Credit.Visible = false
    elseif
    Credit.Visible == false and Frame.Visible == true then
        Frame.Visible = false 
        Credit.Visible = true

    end

end)

0
Can you provide a visual interpretation of your goal - since nothing here is incorrect? It may also help to provide what the current outcome is. SummerEquinox 643 — 5y
0
im trying to make it so that if I click the Credit button The frame will come up and if i click again the frame will go down invisible User#22788 5 — 5y
0
Well you don't need to check the Frame's visibility - just set it after the initial check. Try that and see if it makes any difference. SummerEquinox 643 — 5y

2 answers

Log in to vote
1
Answered by 5 years ago
Credit.MouseButton1Click:Connect(function()
    Frame.Visible = not Frame.Visible
end)
0
Easiest way to do it and it's more efficient. coolboy6786543 113 — 5y
Ad
Log in to vote
-2
Answered by 5 years ago

it should be this instead. give it a try

Credit = script.Parent.Credit
Frame = script.Parent.Frame
TextLabel = Frame.TextLabel

Credit.MouseButton1Click:Connect(function()
    if Credit.Visible == true then
        if Frame.Visible == true then
            Frame.Visible = true
            Credit.Visible = false
        end
    end
end)

Credit.MouseButton1Click:Connect(function()
    if Credit.Visible == false then
        if Frame.Visible == true then
            Frame.Visible = false
            Credit.Visible = true
        end
    end
end)

sometimes breaking things down may be the fix. Not guaranteeing anything though

0
This is the exact same thing as what he has posted - but with two functions, there is more likely than not going to be no difference. Can't hurt to try though. SummerEquinox 643 — 5y

Answer this question