function onClicked()
if game.Workspace.StarterGui.Shop.ImageButton.Frame.Visible = false then
game.Workspace.StarterGui.Shop.ImageButton.Frame.Visible = true
end
script.Parent.MouseButton1Click:connect(onClicked)
function onClicked()
if game.Workspace.StarterGui.Shop.ImageButton.Frame.Visible = true
game.Workspace.StarterGui.Shop.ImageButton.Frame.Visible = false
end
script.Parent.MouseButton1Click:connect(onClicked)
✓ ANSWER ACCEPTED
Can someone help me with this GUI opening script?
1 answer
✓ Accepted answer
Well, you had several errors. Fixed them all up.
script.Parent.MouseButton1Click:connect(function()
if game.Players.LocalPlayer.Shop.ImageButton.Frame.Visible == false then
game.Players.LocalPlayer.Shop.ImageButton.Frame.Visible = true
elseif
game.Players.LocalPlayer.Shop.ImageButton.Frame.Visible == true then
game.Players.LocalPlayer.Shop.ImageButton.Frame.Visible = false
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
it's still not working. I put it in the screengui btw.
The above should be a LocalScript inside of the Button.
Oh, thanks.