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

How to make a Frame Visible onClick?

Asked by 10 years ago

I am making a game basically made of all ScreenGui's and I had an error with this script: Error in script: '=' expected near '<eof>'

basic = game.StarterGui.Tutorials.BasicMath

game.StarterGui.Tutorials.Buttons.Frame.TextButton.MouseButton1Click:connect(function()
    if basic.Frame.Visible == false then
        basic.Frame.Visible = true
    elseif basic.Frame.Visible == true then
        basic.Frame.Visible = false
    end
end)

I have no idea why the error is end of function but I think my script looks fine. Do you guys now the problem?

1 answer

Log in to vote
1
Answered by 10 years ago

Try this:

basic = game.StarterGui.Tutorials.BasicMath

game.StarterGui.Tutorials.Buttons.Frame.TextButton.MouseButton1Click:connect(function()
    basic.Frame.Visible = not basic.Frame.Visible
end)
Ad

Answer this question