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

GUI Shop Open And Close Script Not Working? (SOLVED)

So I am making a GUI shop for my game but when I am trying to make an open/close script, it never seems to work. Am I missing something or doing something wrong? Here is what my localscript contains:

local button = game.StarterGui.Shop.openclose.openclose
local Opened = false
local ShopFrame = button.Parent.Parent.main

button.MouseButton1Click:Connect(function()
	if Opened == false then
		ShopFrame.Visible = true
		Opened = true
	else
		ShopFrame.Visible = false
		Opened = false
	end
end)

Answer: Basically I changed the script so it would work. This is what I got:

local frame = script.Parent.Parent.main
local open = false

script.Parent.openclose.MouseButton1Click:connect(function()
	if frame.Visible == false then
		frame.Visible = true
	else
		frame.Visible = false
	end
end)

1 answer

✓ Accepted answer

You switched up lines 08 and 11, don't worry, it happens to everyone.

3 comments

0

Thanks but for some reason, it still won't open.

0

Hmm. Select it in test mode's explorer, click the button. Does it change it's Visible property? Put a print after line 05 and see if it reaches that point?

0

It's already solved clc02 but thanks for trying!

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