So I have a weapon shop, and if you click on this button on the side of your screen the shop is visible. I have it so that to make space for the GUI the core GUI's are disabled, but if the frame is not visible the GUI's are enabled. Here's the script:
frame = game.StarterGui.WeaponShopGUI.WeaponShopFrame
script.Parent.MouseButton1Click:connect(function()
script.Parent.Parent.WeaponShopFrame.Visible = not script.Parent.Parent.WeaponShopFrame.Visible
if frame.Visible == true then
local StarterGui = game:GetService('StarterGui')
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
elseif frame.Visible == false then
local StarterGui = game:GetService('StarterGui')
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
end
end)
if you click the button once, it works, but if you click it again to exit it, it stays disabled, any help? Also as a side question if a frame is not visible is it still enabled, I don't want my players to accidentally buy a gun, and if it is how do I change that?

1 comment
thanks!