0

# Disabling a GUI while opening another?

So I have 2 GUI's, a shop GUI and a XP gui. The problem is when I'm entering the shopGUI(It's activated by hitting a brick) the XP Gui is blocking the view of the shop. My question is, what script would be able to disable the "XP GUI" when stepping on the "shopbrick", and when pressing the closebutton on the shop, it would enable the XPGui again?

This is my "OpenShop" script and in the 5th line I tried to add a code, but seems not to work.

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
game.ReplicatedStorage.TriggerCam:FireClient(player)
game.StarterGui.XPBar.Enabled = false
end
end)


And here's my "closebutton" on the ShopGUI, see line 21

script.Parent.MouseButton1Click:Connect(function()
local player = game.Players.LocalPlayer
local shop = player.PlayerGui.Shop
local camera = workspace.CurrentCamera
local item = shop.Item

if shop.Open.Value == true then
shop.Open.Value = false
shop.Frame:TweenPosition(UDim2.new(0,0,1,0),"Out","Quint",1,true)
item.Value = 1
camera.CameraType  = Enum.CameraType.Custom
camera.CameraSubject = player.Character.Humanoid
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)