Please Help me Would this be script be somewhat Correct?
function onClick() if game.StarterGui.ScreenGui.TextButton.Visible == true then game.StarterGui.ScreenGui.TextButton.Visible = false end end
game.StarterGui.ScreenGui.TextButton.Visible.MouseButton1Down:connect(onClick)
That's one way to do it and it looks good! However, I recommend testing this on your own and see if you can come up with other ideas. :)
Another way you could have done this would be:
local textbutton = script.Parent -- since the script is located inside the Textbutton, we declare this function onClick() if textbutton.Visible then --If the TextButton exist and it's visible then... textbutton.Visible = false -- We set it to false end end textbutton.MouseButton1Down:connect(onClick) -- We connect the function
The best way to know if something will work is to test it yourself. Try seeing what works with it and what does not (the print function really helps with this). Keep in mind that click events do not fire on the server if you have the FilteringEnabled property set to true on the Workspace.
Also, please use a code block when showing code. It makes it easier for people like me to see and interpret it.