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

Can someone please tweak my script and tell me what I did wrong? (I'm trying to make a shop GUI)

Note: The frame is not the parent of the text button

script.Parent.MouseButton1Down:Connect(function() script.Parent.Parent.Frame.Visible = true end)

1 comment

0

pls use a code block

2 answers

I see what you are trying to do, and see no point in not helping out.

local Frame = script.Parent.Parent.Frame
local OpenButton = script.Parent
local Open = false

OpenButton.MouseButton1Click:Connect(function()
	if Open == false then
		Open = true
		--[[Optional:
		Open.Text = "Close Shop"
		]]--
		Frame.Visible = true
	elseif Open == true then
		Open = false
		--[[Optional:
		Open.Text = "Open Shop"
		]]--
		Frame.Visible = false
	end
end)

To further explain the script, it is a open and close script that should be placed in the button, and also make sure that the frame and button are in the correct places.

Hope this helps, Happy scripting!

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