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 6 years ago
01Credit = script.Parent.Credit
02Frame = script.Parent.Frame
03TextLabel = Frame.TextLabel
04 
05Credit.MouseButton1Click:Connect(function()
06    if Credit.Visible == true and Frame.Visible == false then
07        Frame.Visible = true
08        Credit.Visible = false
09    elseif
10    Credit.Visible == false and Frame.Visible == true then
11        Frame.Visible = false
12        Credit.Visible = true
13 
14    end
15 
16end)
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 — 6y
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 — 6y
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 — 6y

2 answers

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

it should be this instead. give it a try

01Credit = script.Parent.Credit
02Frame = script.Parent.Frame
03TextLabel = Frame.TextLabel
04 
05Credit.MouseButton1Click:Connect(function()
06    if Credit.Visible == true then
07        if Frame.Visible == true then
08            Frame.Visible = true
09            Credit.Visible = false
10        end
11    end
12end)
13 
14Credit.MouseButton1Click:Connect(function()
15    if Credit.Visible == false then
View all 21 lines...

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 — 6y

Answer this question