Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make shop Gui not appear after closing it?

Asked by 4 years ago

So basically, I have a shop GUI and I want to have it so that you can close out of it before walking away. The problem is that if you close the window before walking away, you end up triggering the part that pops it up again. Is there a way to negate this?

LocalScript that closes it (Programs the close button.)

--Code by EnderVolts


local playergui = game.Players.LocalPlayer.PlayerGui
local gui = playergui.appliances_gui

print("Script for closing the Appliance Gui succesfully started")
local function closeGui() --Defines a function that sets the shop's ScreenGui to disabled.
    gui.Enabled = false
    print("Closed Appliance GUI")
end

script.Parent.MouseButton1Click:connect(closeGui) --Makes it so that when you click the 'x' button it triggers closeGui()

LocalScript that opens it (Programs invisible part to open the Gui.)

--Code by EnderVolts


local playergui = game.Players.LocalPlayer.PlayerGui
local gui = playergui.appliances_gui

print("Script for closing the Appliance Gui succesfully started")
local function closeGui() --Defines a function that sets the shop's ScreenGui to disabled.
    gui.Enabled = false
    print("Closed Appliance GUI")
end

script.Parent.MouseButton1Click:connect(closeGui) --Makes it so that when you click the 'x' button it triggers closeGui()
0
Dude you pasted the same script benjinanas 50 — 4y
0
Hello? benjinanas 50 — 4y

Answer this question