local Inventory = game.Players.LocalPlayer.PlayerGui:findFirstChild("Inventory") local Shop = game.Players.LocalPlayer.PlayerGui:findFirstChild("Shop") function openShop() Inventory.Enabled = false Shop.Enabled = true end script.Parent.Frame.Shop.MouseButton1Click:connect(openShop)
Inventory and Shop are both ScreenGuis
For some reason there's an error on the "Inventory.Enabled = false" and I'm not sure why.
The first thing I see is to try to change findFirstChild to FindFirstChild
I find that if you mess up a capitalization it can error the script completely so try this and tell me your result
Here is the updated script.
local Inventory = game.Players.LocalPlayer.PlayerGui:FindFirstChild("Inventory") local Shop = game.Players.LocalPlayer.PlayerGui:FindFirstChild("Shop") function openShop() Inventory.Enabled = false Shop.Enabled = true end script.Parent.Frame.Shop.MouseButton1Click:connect(openShop)
Found the solution. It was because the localscript was inside a screengui instead of directly under "StarterGui".