I am trying to make a close gui button but its not working
But its returning an error
I renamed the Frame as
Please help it would help my game progress further
Thanks
I am trying to make a close gui button but its not working
But its returning an error
I renamed the Frame as
Please help it would help my game progress further
Thanks
Try to put in the variable: script.Parent.Close
Also if you can send a full screenshot of the explorer.
In which variable should I put in?
Show your explorer.
character limit
Include the full directory and the ancestory of the ScreenGUI. It will then let us help you better.
Hi, try putting that in the frame variable and check if it works.
i see the error text
Fin let me check it and check if it works
Hello, the problem is that you’re putting an extra .Close
on the variable, btw I would recommend doing it in this way:
local Frame = script.Parent.Parent
local Button = script.Parent
Button.MouseButton1Up:Connect(function()
Frame.Visible = not Frame.Visible
end)
Try Sarchyx’s method. It will work.
I tried to do it his way and it worked
Both are correct, but it’s completely useless to use .Parent.Close
because it will just go to its parent and then go back.
Yep It worked Thanks for the help
Do you know the difference between the both
Mark Sarchyx’s post as the solution.
personally I would do it like this
local Button = script.Parent
local Frame = Button.Parent
doesn’t have any repeated code
The one Sarchyx posted would, if you were to have another error or not, be easier to understand and would remove some code.
Let me try that and see if it works