I have a shop that I have scripted, everything works but, when a player joins or dies, the shop is open, here is the script of the shop on button:
script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.Parent.Parent.ShopGUI.MainFrame.Visible = true print('Shop Opened!') end)
I would appreciate it if the answer could be a part of this script, but anything is appreciated, thanks!
local ShopGUI = script.Parent.Parent.Parent.Parent.ShopGUI -- make variables to shorten script. ShopGUI.MainFrame.Visible = false --make sure its not visible when a player spawns. script.Parent.MouseButton1Click:connect(function() if ShopGUI.MainFrame.Visible == false then ShopGUI.MainFrame.Visible = true print('Shop Opened!') end end)