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

Can someone help me with this GUI opening script?

function onClicked()
	if game.Workspace.StarterGui.Shop.ImageButton.Frame.Visible = false then
		
	game.Workspace.StarterGui.Shop.ImageButton.Frame.Visible = true
end
	script.Parent.MouseButton1Click:connect(onClicked)
	
	function onClicked()
		if game.Workspace.StarterGui.Shop.ImageButton.Frame.Visible = true
		game.Workspace.StarterGui.Shop.ImageButton.Frame.Visible = false
		end
		
		script.Parent.MouseButton1Click:connect(onClicked)

1 answer

✓ Accepted answer

Well, you had several errors. Fixed them all up.

script.Parent.MouseButton1Click:connect(function()
	if game.Players.LocalPlayer.Shop.ImageButton.Frame.Visible == false then
		game.Players.LocalPlayer.Shop.ImageButton.Frame.Visible = true
	elseif
		game.Players.LocalPlayer.Shop.ImageButton.Frame.Visible == true then
			game.Players.LocalPlayer.Shop.ImageButton.Frame.Visible = false
		end
end)

3 comments

0

it's still not working. I put it in the screengui btw.

1

The above should be a LocalScript inside of the Button.

0

Oh, thanks.

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