I am working on a home store, and I want to open a buy/try GUI by changing its visibility, but it doesn't work for me. It only works if I open the GUI manually from the explorer while in-game.
p = game.Players.LocalPlayer Frame = p.PlayerGui.BuyGUI.Frame script.Parent.ClickDetector.MouseClick:Connect(function() Frame.Visible = true end)
Put Buygui in click detector, and put local script in StarterGui.
local player = game.Players.LocalPlayer -- Define the local player local playerGui = player:WaitForChild("PlayerGui") -- Define the player's player gui local part = workspace:WaitForChild("Part") -- Change the 'part' to your part local cd = part:FindFirstChild("ClickDetector") -- Define the click detector local gui = cd:FindFirstChild("BuyGui") -- Define your gui (insert it to part's click detector) cd.MouseClick:Connect(function() if not playerGui:FindFirstChild(gui.Name) then gui:Clone().Parent = playerGui elseif playerGui:FindFirstChild(gui.Name) then playerGui:FindFirstChild(gui.Name):Destroy() end end)