I need help with a shop button that opens up the shop but when clicked again closes the shop. Hers my current script:
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function() player.PlayerGui.gameshop.Frame.Visible = true end)
script.Parent.MouseButton1Click:Connect(function() script.Parent.Visible = not script.Parent.Visible end)
If script.Parent.Visible is true, which translating "not script.Parent.Visible" becomes to "not true" is false, it will set the visible status to false
But if the script.Parent.Visible is false, which translating "not script.Parent.Visible" becomes to "not false" is true, hence setting the visible status to true
Alright, so. I'll assume that the frame is named "Frame."
Put this as local script inside the button.
local open = false -- Don't touch this local frame = script.Parent.Parent.Frame script.Parent.MouseButton1Click:Connect(function() if not open then -- If it is closed frame.Visible = true else frame.Visible = false end end