What do you want to achieve? Keep it simple and clear!
Make a gui appear when you click a icon (not a text label)
What is the issue? Include screenshots / videos if possible!
The gui won’t show
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried removing the ) at the end and also tried to connect the function but that didn’t work since if remember correctly, that’s used for click detectors or either I did it wrong.
Script:
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Parent.Box.Visible = false
then script.Parent.Parent.Box.Visible = true
else
script.Parent.Parent.Box.Visible = false
end
end)
Please include all of the code, since you currently lack a method that detects when a button is pressed. Also include a screenshot of how your UI is setup, and where your script is in said UI.
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Box.Visible == false
then script.Parent.Box.Visible = true
else
script.Parent.Box.Visible = false
end
end)
You were missing a double “==” for is equal to, in the conditional statement.
Also that script will need to be a local script not a server script like your screenshot shows. Oh, and I’ve fixed the references to the correct “Box” instance that you’re trying to fetch.
When OP originally posted they did not have this in their code which is why I asked for more code. Based on what OP said in their post I was under the assumption they had not included any events to detect when a GuiObject is clicked. Rather than assuming this I asked for additional code before attempting to debug it. I also asked for a screenshot to properly debug the setup of their explorer tree, which as we can see was necessary.