BumpyPlayz

Script 12 Tool Shop Gui

Feb 5th, 2020
1,129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. script.Parent.Parent.Frame.Position = UDim2.new(0.199, 0,-1, 0)
  2.  
  3.  
  4. function open()
  5.     local done = false
  6.     repeat
  7.         if script.Parent.Parent.Debounce.Value == false then
  8.             done = true
  9.         end
  10.         wait(0.01)
  11.     until done == true
  12.     if script.Parent.Value == true then
  13.         script.Parent.Parent.Debounce.Value = true
  14.         script.Parent.Parent.Frame:TweenPosition(UDim2.new(0.199, 0,0.198, 0), "Out", "Elastic", 2)
  15.         wait(2)
  16.         script.Parent.Parent.Debounce.Value = false
  17.     end
  18.    
  19. end
  20.  
  21. function close()
  22.    
  23.     local done = false
  24.     repeat
  25.         if script.Parent.Parent.Debounce.Value == false then
  26.             done = true
  27.         end
  28.         wait(0.01)
  29.     until done == true
  30.     if script.Parent.Value == false then
  31.         script.Parent.Parent.Debounce.Value = true
  32.         script.Parent.Parent.Frame:TweenPosition(UDim2.new(0.199, 0,2, 0), "Out", "Elastic", 2)
  33.         wait(2)
  34.         script.Parent.Parent.Debounce.Value = false
  35.     end
  36. end
  37.  
  38.  
  39. script.Parent.Changed:Connect(function()
  40.     open()
  41.     close()
  42. end)
Add Comment
Please, Sign In to add comment