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

The title is to long ill just put it in the Problem Box?

Asked by 4 years ago

if script.Parent.Parent.Visible == false then script.Parent.MouseButton1Click:Connect(function(player) script.Parent.Parent.Visible = true

end

Please fix this script i'm trying to make a menu button for a GUI.

Players.JAX_AtRB.PlayerGui.ForNIBS2.Frame.Menu.LocalScript:6: Expected ')' (to close '(' at line 3), got <eof>

2 answers

Log in to vote
0
Answered by 4 years ago
script.Parent.MouseButton1Click:Connect(function(player)
script.Parent.Parent.Visible == true

You probably don't need the if visible == false because it's a MouseButton1Click function, and you are setting what happens when you click whatever you are trying to target. To make things less complicated, you could insert another TextButton up on top of the GUI, and put a script into it as when you click it, it turns your GUI invisible.

If you need any further help, feel free to comment and I'll see what I can do.

0
Thanks! JAX_AtRB -1 — 4y
Ad
Log in to vote
0
Answered by 4 years ago
if script.Parent.Parent.Visible == false then
    script.Parent.MouseButton1Click:Connect(function(player)
        script.Parent.Parent.Visible = true
    end)
end

You could also do it like this if you want the visibility to be the opposite to what it currently is when you click the button

script.Parent.MouseButton1Click:Connect(function(player)
    script.Parent.Parent.Visible = not script.Parent.Parent.Visible
end)
0
But why would you do that if you're creating a shop? It just adds more complexity. Auxatier 59 — 4y

Answer this question