If you already have the gui set up, then you will want to create a TextButton not a TextBox. Then link the mouse button down to a function like so:
[textbutton variable].MouseButton1Down:connect(function()
then inside the function create a new textbox and put the rules there. If you want the rules to be able to disappear, then inside the function create a new text button with labeled something (ex. close) and make the original text button invisible and inactive. Then to make the open button reappear, bind the mouse click to a new function and inside the function make the original button visible and active then delete the rules text box and the close text button. Here is an example script
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(.5,0,.5,0)
textButton.Size = UDim2.new(0, 150, 0, 50)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "Open"
textButton.MouseButton1Click:connect(function(open)
local rules = Instance.new("TextBox")
rules.Parent = screenGui
rules.Position = UDim2.new(.5,0,.6,0)
rules.Size = UDim2.new(0, 150, 0, 50)
rules.BackgroundColor3 = BrickColor.White().Color
rules.Text = "No!"
local textButton2 = Instance.new("TextButton")
textButton2.Parent = screenGui
textButton2.Position = UDim2.new(.5,0,.5,0)
textButton2.Size = UDim2.new(0, 150, 0, 50)
textButton2.BackgroundColor3 = BrickColor.White().Color
textButton2.Text = "Close"
textButton.Visible = false
textButton.Active = false
textButton2.MouseButton1Click:connect(function(close)
textButton.Visible = true
textButton.Active = true
rules:Destroy()
textButton2:Destroy()
end)
end)
If you have any questions then just PM me :D
1 comment
Provide some of your scripting to let us make it easier to help you.