Free-Scripts

Key Script

Jul 22nd, 2021 (edited)
2,856
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. local key = script.Parent.Parent.key
  2.  
  3. script.Parent.MouseButton1Click:Connect(function()
  4.     if key.Text == "Key" then -- Make the "Key" whatever you wish.
  5.         script.Parent.Parent:TweenPosition(UDim2.new(0.383,0,-0.9,0), "Out", "Quad", 1, true)
  6.         script.Parent.Parent.Parent.Frame.Visible = true
  7.         wait(5)
  8.         script.Parent.Parent:Destroy() -- Destroys the GUI after a set time
  9.         print("Destroyed!")
  10.     elseif -- Tweening | If you want it to do a different tween just change the "Quad" to another tween animation
  11.         key.Text == "" then
  12.         key.Text = "" else
  13.         key.Text = "Incorrect, try again."
  14.         wait(1)
  15.         key.Text = ""
  16.     end
  17. end)
  18.  
  19. -- Video: https://youtu.be/hy1Tcwr3PRY
Add Comment
Please, Sign In to add comment