Advertisement
WINXSITO

BOTON GUI 1

Apr 24th, 2021
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local frame = script.Parent.Parent.Frame
  2. local tecla = Enum.KeyCode.N
  3.  
  4. local UIS = game:GetService("UserInputService")
  5. local abrir = false
  6.  
  7. UIS.InputBegan:Connect(function(key)
  8.     if key.KeyCode == tecla then
  9.         if UIS:GetFocusedTextBox() == nil then
  10.             if abrir == false then
  11.                 abrir = true
  12.                 frame.Visible = abrir
  13.             elseif abrir == true then
  14.                 abrir = false
  15.                 frame.Visible = abrir
  16.             end
  17.         end
  18.     end
  19. end)
  20.  
  21. script.Parent.MouseButton1Click:Connect(function()
  22.  
  23.     if abrir == false then
  24.         abrir = true
  25.         frame.Visible = abrir
  26.     elseif abrir == true then
  27.         abrir = false
  28.         frame.Visible = abrir
  29.     end
  30. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement