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

My shop is open on player join and death?

Asked by
awfulszn 394 Moderation Voter
8 years ago

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!

1 answer

Log in to vote
-1
Answered by 8 years ago

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)
0
I changed the script to that, but when I click play, the shop is open when I join awfulszn 394 — 8y
0
Purhaphs your path is wrong, check it ConnorXV 5 — 8y
Ad

Answer this question