Advertisement
Joriangames

Open / Close button

Apr 26th, 2022
1,015
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. --[[
  2. Thanks for using this script
  3. Want to know how to use this and script explanation?
  4. Check out my video here: https://youtu.be/aCs3f-nVWrE
  5.  
  6. ]]
  7.  
  8. local frame = script.Parent.Parent.Frame --Here we get the frame that we will give the ability to open/close. Don't change this line!
  9.  
  10. script.Parent.MouseButton1Click:Connect(function()  --Function which runs when the button is clicked
  11.     if frame.Visible == false then                  --Here we check if the frame is visible if it's not then..
  12.         frame.Visible = true                        --then we make frame visible
  13.     else                                            --Otherwise.. (so if the frame was already visible then..)
  14.         frame.Visible = false                       --We will make frame invisible
  15.     end                                             --We end the if-statement here
  16. end)                                                --We end the function here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement