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

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

Asked by 8 years ago

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)

2) Screencapture of the contents of the GUI:

https://gyazo.com/191edb0518b3b7a5c491851f5889fe95

3) Video of what happens:

https://youtu.be/jaZ4jIaughc

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

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 arrowman888 69 — 8y
1
also this looks the EXACT SAME as my script and mine works veryyy weird arrowman888 69 — 8y
0
@arrow Nope, thanks for trying to help tho. Any other ideas? OpticUniversse 50 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago
Edited 8 years ago

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)
0
Thanks! OpticUniversse 50 — 8y
1
No problem! ;) Kyleocraft 25 — 8y
Ad

Answer this question