Roblox Studio is tweaking

Recently I have this problem on my game where when I close my gui and try to open it via script it does not open. I am trying to open a frame by checking the visible bool to true. Here is my script

local dialog = require(game.ReplicatedStorage.Modules.Dialog)
local plrr
local cooldown = false

function option1()
	plrr.PlayerGui.MainGUI.Dialog:Destroy()
	plrr.PlayerGui.MainGUI.GunShop.Visible = true
end

function option2()
	plrr.PlayerGui.MainGUI.Dialog:Destroy()
end

script.Parent.MouseClick:Connect(function(plr)
	dialog.CreateDialog(plr, "Gun Dealer", "ay, choose any gun quickly, ight?", "Alr", "Nevermind", option1, option2)
	plrr = plr
end)

and here is my close script

script.Parent.MouseButton1Up:Connect(function()
	script.Parent.Parent.Visible = false
end)

Sorry for my bad code

Maybe try to hide it instead of destroying it.

function option1()
    plrr.PlayerGui.MainGUI.Dialog.Visible = false
    plrr.PlayerGui.MainGUI.GunShop.Visible = true
end

function option2()
    plrr.PlayerGui.MainGUI.Dialog.Visible = false
end

its not the dialog its the shop

Maybe you are hiding the parent of the GunShop, instead of the GunShop itself, in the close script

The parent of the gunshop is the parent of all the gui in the game, so the other gui show

Send screenshot of the hierarchy of the frames and scripts

image
image