I am making a Shop where if you click the NPC, it opens the shop GUI and closes the Close button. So far it works but if I close the shop and try to open it again it won’t open. Here is the script inside the click detector which is inside the NPC:
script.Parent.MouseClick:Connect(function(player)
player:WaitForChild("PlayerGui").ToolShop.Frame.Visible = true
end)
But here is the script inside the close button:
script.Parent.MouseButton1Down:Connect(function(player)
game.Players.LocalPlayer.PlayerGui.ToolShop.Frame.Visible = false
end)
What is wrong?