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
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.