local shop = game.Players.LocalPlayer.PlayerGui.Shop.Frame
local button = game.Players.LocalPlayer.PlayerGui.Shop.TextButton
function close()
shop.visible = false
button.visible = true
script.Parent.MouseButton1Click:Connect(close)
end
idk whats wrong

1 comment
You're having the event within the function which it is calling. Just have your text on line 7 after the end. Also capitalize the V in Visible. Capitalization matters most of the time.