Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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)
0
Where is the script located? Pojoto 329 — 5y
0
in the script button Zeppelin0330 38 — 5y
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. User#19524 175 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

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.

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. User#19524 175 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

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

Answer this question