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

How do I use ButtonGUI's usable?

Asked by 4 years ago

I am making a game and I need a button to open rules. I know how to make things visible etc. but I don't know how to make a ButtonGUI usable. Please reply with a working script. Thanks!

If you were wondering if I know how to make the rules be invisible, here's a line of script that I know.

Game.workspace.TextBox.transparency = 1

1 answer

Log in to vote
0
Answered by 4 years ago

You should put the ScreenGui in StarterGui. Then, put a TextButton(or ImageButton) and the TextBox in the ScreenGui. Then, you should put a LocalScript into it.

Here is the code(with the explanation):

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Parent.TextBox.Visible = not script.Parent.Parent.TextBox.Visible 
end)

This will make if script.Parent.Parent.TextBox.Visible is true(visible) and the button is pressed, then it will make it invisible(false(the opposite of true).

If script.Parent.Parent.TextBox.Visible is false(invisible) and the button is pressed, then it will make it visible(ftruethe opposite of false).

Sorry for the bad explanation.

0
Thanks lol! fundayelover 2 — 4y
Ad

Answer this question