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

How do I make opening and closing a shop gui work?

I have tried so many different youtube tutorials but none seem to work.

Problem: ShopFrame will not close when x button clicked or open when shop button clicked.

OpenScript:

script.Parent.MouseButton1Click:Connect(function()
 script.Parent.Parent.Shop.Visible = true
end)

CloseScript:

script.Parent.MouseButton1Click:Connect(function()
 script.Parent.Parent.Visible = false
end)?

Image: https://drive.google.com/file/d/1WFFLfKm8kEopEio0xC4fZXjJXsZWm9RU/view?usp=sharing

3 comments

0

Are they enabled? Also theres a ? at the end of close script, i assume thats a typo.

0

Make sure everything within the shopframe is also set to visible.

0

Hey man, my answer solved your problems but you forgot to accept.

1 answer

✓ Accepted answer

For first, you are using "Shop" not "ShopFrame"(name of your frame) the close script is correct(only remove the ?) but on your OpenScript you are Using the name "Shop" not "ShopFrame" Using the "Shop" will return error. Only change the "Shop" to "ShopFrame"

Here is fixed script: (Open Script)

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.ShopFrame.Visible = true
end)

(Close Script)

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Visible = false
end) -- Only removed the "?" from here

Hope it helped :)

2 comments

0

Thank you so much! I literally started using roblox studio today so sorry for the stupid question. Would upvote but don't have enough reputation lol

0

Accept answer

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