Advertisement
HowToRoblox

Button1Script

Jun 22nd, 2020
18,187
1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 1 0
  1. local btn = script.Parent
  2.  
  3. local isHovering = false
  4.  
  5.  
  6. btn.MouseEnter:Connect(function()
  7.    
  8.     isHovering = true
  9.    
  10.     btn:TweenSize(UDim2.new(0.281, 0, 0.138, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
  11. end)
  12.  
  13. btn.MouseLeave:Connect(function()
  14.    
  15.     isHovering = false
  16.    
  17.     btn:TweenSize(UDim2.new(0.273, 0, 0.134, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
  18. end)
  19.  
  20. btn.MouseButton1Down:Connect(function()
  21.    
  22.     btn:TweenSize(UDim2.new(0.265, 0, 0.13, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
  23. end)
  24.  
  25. btn.MouseButton1Up:Connect(function()
  26.    
  27.     if not isHovering then
  28.         btn:TweenSize(UDim2.new(0.273, 0, 0.134, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
  29.     else
  30.         btn:TweenSize(UDim2.new(0.281, 0, 0.138, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
  31.     end
  32. end)
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement