Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My shop is open on player join and death?

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

✓ Accepted answer

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)

2 comments

0

I changed the script to that, but when I click play, the shop is open when I join

0

Purhaphs your path is wrong, check it

This discussion is preserved as it was. New answers, comments, and votes are closed.