I made a GuiButton that makes a frame visible if pressed the first time but then I want it to make the frame invisible if pressed again and for the cycle to repeat. Here is my code. I can't think straight.
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Down:Connect(function()
player.PlayerGui.Store.Frame.Visable = true
end)
if player.PlayerGui.Store.Frame.Visable = true then player.PlayerGui.Store.Frame.Visable = false end
it's Visible not Visable
Try this:
local player = game.Players.LocalPlayer script.Parent.MouseButton1Down:Connect(function() player.PlayerGui.Store.Frame.Visible = true if script.Parent.MouseButton1Down then player.PlayerGui.Store.Frame.Visible = false end end)
Srry for the bad formatting on mobile