local Space = game.StarterGui.ScreenGui.Space local SecondFrame = game.StarterGui.ScreenGui.SecondFrame MouseButton1Click:Connect(function() Space.Visible = false SecondFrame.Visible = true end
Error: Players.DevSeveral.PlayerGui.ScreenGui.TextButton.LocalScript:7: Expected ')' (to close '(' at line 4), got <eof> Layout:https://i.gyazo.com/bfe052345f8d803d98ac68945fc18fcc.png
I am trying to make it when someone clicks that button the Frame becomes not visible and another one becomes visible
The frame I want to be not invisible is 'Space' and the one I want to be visible is 'SecondFrame'
Try this:
local Space = script.Parent.Parent.Space local SecondFrame = script.Parent.Parent.SecondFrame function onClick() Space.Visible = false SecondFrame.Visible = true end script.Parent.MouseButton1Click:connect(onClick)
Or if you want to make it so that when you click it shows, and when you click again it disappears
local Space = script.Parent.Parent.Space local SecondFrame = script.Parent.Parent.SecondFrame function onClick() if Space.Visible == false then Space.Visible = true elseif Space.Visible == true then Space.Visible = false end if SecondFrame.Visible == false then SecondFrame.Visible = true elseif SecondFrame.Visible == true then SecondFrame.Visible = false end end script.Parent.MouseButton1Click:connect(onClick)