Advertisement
Alief_Athallah

Open and Close Script

Aug 8th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. -- Put this LocalScript inside TextButton --
  2.  
  3. local Gui = script.Parent.Parent.Background
  4. local btn = script.Parent
  5.  
  6. btn.MouseButton1Click:Connect(function()
  7.     Gui.Visible = not Gui.Visible
  8.     if Gui.Visible == true then
  9.         btn.Text = "<" -- This will change the text when opened --
  10.        
  11.     elseif Gui.Visible == false then
  12.         btn.Text = ">"
  13.        
  14.     end
  15. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement