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

The shop GUI opens in studio but not in the actual game??

Hi I'm made a shop GUI. All the buttons work like giving you the item and taking away the points but for some reason the GUI will only open in studio not the published game.

Cheers

This is the code to open and close the Shop.

Button = script.Parent
ok = script.Parent.Parent.ok
Open = true

function OnButtonClick()
	if Open == true then
	Button.Text = "Close"
	ok.Visible = true
	Open = false
elseif Open == false then
	Button.Text = "Shop"
	ok.Visible =  false
	Open = true
	end
	
	end

script.Parent.MouseButton1Down:connect(OnButtonClick)

1 comment

0

Try changing the last line, line 18 to, script.Parent.MouseButton1Click:connect(OnButtonClick) I hope this works.

1 answer

I suggest just changing the function to Button.MouseButton1Click:connect(function(). You would also be able to remove the final line at the end using this.

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