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

My gamepass shop gui works in roblox studio but not in game and as I can see it says no error?

If you have an idea or tip please write it in the answers. It doesn't write that there is a problem with the script or at least I can't find it. As ever any help will be appreciated. Here is the script.

script.Parent.MouseButton1Down: connect (function()
	script.Parent.Parent.ShopFrame.Visible = not script.Parent.Parent.ShopFrame.Visible
end)

3 comments

0

Where is the script located?

0

in the script button

0

Is it a LocalScript? And there is a space between the :, connect, and (function(). So remove the spaces. And connect is deprecated so use Connect.

2 answers

✓ Accepted answer

First of all,

Please remove the spaces between MouseButton1Down: and :connect. Also remove the spaces between :connect and (function().

Second of all,

:connect is deprecated. Use :Connect instead.

Third of all,

You should use false instead of not at line 2.

Fourth of all,

If this is a script, put it into a localscript. That is the most likely problem if you script works in ROBLOX studio but not in your game.

1 comment

0

"Third of all, You should use false instead of not at line 2." No. OP was correct for doing that. Better than making multiple if statements JUST to check visibility.

Just make this script as LocalScript And add at the start wait(0.1)

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