Advertisement
aiden50_70

Untitled

Jun 3rd, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. local function addButtons()
  2. local example = Frame.example
  3. local X,Y = 10,10
  4. for i,v in pairs(things) do
  5. if X > 550 then
  6. X = 10
  7. Y = Y + 30
  8. end
  9. local k = example:Clone()
  10. k.Text = v.__name
  11. k.MouseButton1Click:Connect(v.__run)
  12. k.Visible = true
  13. k.Size = UDim2.new(0,0,0,0)
  14. k.Position = UDim2.new(0,X,0,Y)
  15. k.Parent = Frame.ScrollingFrame
  16. k:TweenSize(example.Size,'InOut','Sine',.5)
  17. local script = Instance.new('LocalScript',k)
  18. local currentCircle
  19. local burst = false
  20. local function makeRipple(x, y, obj)
  21. local img = Instance.new("ImageLabel")
  22. currentCircle = img
  23. img.BackgroundTransparency = 1
  24. img.BorderSizePixel = 0
  25. img.Image = "rbxasset://textures/whiteCircle.png"
  26. img.ImageTransparency = 0.25
  27. img.ImageColor3 = Color3.new(1, 1, 1)
  28. img.Size = UDim2.new(0, 0, 0, 0)
  29. img.Position = UDim2.new(0, x - obj.AbsolutePosition.X, 0, y + -36 - obj.AbsolutePosition.Y)
  30. img.Parent = obj
  31. img:TweenSize(UDim2.new(0, 600, 0, 600), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 2, true)
  32. img.ImageColor3 = Color3.fromRGB(34, 178, 255)
  33. img.AnchorPoint = Vector2.new(0.5, 0.5)
  34. img.ZIndex = obj.ZIndex
  35. end
  36.  
  37. local fadeOut = function(obj)
  38. local tweenService = game:GetService("TweenService")
  39. local info = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)
  40. local goal = {ImageTransparency = 1}
  41. local tween = tweenService:Create(obj, info, goal)
  42. tween:Play()
  43. wait(0.75)
  44. obj:Destroy()
  45. end
  46. local deb, op = false, false
  47. script.Parent.MouseButton1Down:Connect(function(x, y)
  48. burst = true
  49. makeRipple(x, y, script.Parent)
  50. end)
  51. script.Parent.MouseButton1Up:Connect(function()
  52. local e = currentCircle
  53. burst = false
  54. for i = 0.1, 1, 0.045 do
  55. e.ImageTransparency = i
  56. wait()
  57. end
  58. e:Destroy()
  59. end)
  60. script.Parent.MouseLeave:Connect(function()
  61. for i, v in pairs(script.Parent:GetChildren()) do
  62. if v ~= currentCircle and not v:IsA("LocalScript") then
  63. fadeOut(v)
  64. end
  65. end
  66. end)
  67.  
  68. X = X + 140
  69. table.insert(buttons,k)
  70. wait(.1)
  71. end
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement