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

My shop GUI will close, but not re-open afterwards?

I attached both a video and the close/open GUI, as well as the entire gui contents in a screenshot. It's a little jumbled, but I spent an hour tweaking it and it would be great if there's a fix. Thanks!

  1. In the close/open script:
script.Parent.MouseButton1Click:connect(function()
	mainShop = script.Parent.Parent.MainShop
	if mainShop.Visible == false then
		mainshop.Visible = true
		script.Parent.Text = "Close"
	else
		mainShop.Visible = false
		script.Parent.Text = "Open"
	end
end)

  1. Screencapture of the contents of the GUI:

https://gyazo.com/191edb0518b3b7a5c491851f5889fe95

  1. Video of what happens:

https://youtu.be/jaZ4jIaughc

If anyone can figure this out, it'd mean a lot. Thanks!

3 comments

1

try making it repeat im not 100% sure but for now just do a simple while true do and see if it works if it doesnt then idk i have a shop that works

1

also this looks the EXACT SAME as my script and mine works veryyy weird

0

@arrow Nope, thanks for trying to help tho. Any other ideas?

1 answer

✓ Accepted answer

You forgot to capitalize the S 'mainShop' on line 4.

Corrected code should look like this:

script.Parent.MouseButton1Click:connect(function()
    mainShop = script.Parent.Parent.MainShop
    if mainShop.Visible == false then
        mainShop.Visible = true
        script.Parent.Text = "Close"
    else
        mainShop.Visible = false
        script.Parent.Text = "Open"
    end
end)

2 comments

0

Thanks!

1

No problem! ;)

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