Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a Frame Visible onClick?

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

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

Try this:

basic = game.StarterGui.Tutorials.BasicMath

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

This discussion is preserved as it was. New answers, comments, and votes are closed.