I made a shop for an rpg in roblox and I can open it and close it, but after I close it, it won't open again and says "Already have GUI." My shop script it
button = script.Parent function onTouch(part) if part.Parent:FindFirstChild("Humanoid") ~= nil then local player = Game.Players:GetPlayerFromCharacter(part.Parent) if player ~= nil then local GUI = Game.ReplicatedStorage:FindFirstChild(script.Parent.ShopGUI.Value) local AlreadyHaveGUI = player.PlayerGui:FindFirstChild(script.Parent.ShopGUI.Value) if AlreadyHaveGUI == nil then GUI:Clone().Parent = player.PlayerGui else print("Already have GUI!") end end else print("Humanoid not found!") end end button.Touched:connect(onTouch)
and my close script is
function close() script.Parent.Parent.Parent:Remove() end script.Parent.MouseButton1Click:connect(close)