Hellotop2

Untitled

Jan 22nd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.42 KB | None | 0 0
  1. -- Objects
  2.  
  3. local ScreenGui = Instance.new("ScreenGui")
  4. local Frame = Instance.new("Frame")
  5. local RippleEffect = Instance.new("TextButton")
  6. local ImageLabel = Instance.new("ImageLabel")
  7. local TextLabel = Instance.new("TextLabel")
  8. local Circle = Instance.new("ImageLabel")
  9.  
  10. -- Properties
  11.  
  12. ScreenGui.Parent = game.CoreGui
  13. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  14.  
  15. Frame.Parent = ScreenGui
  16. Frame.BackgroundColor3 = Color3.new(1, 1, 1)
  17. Frame.BorderColor3 = Color3.new(0.811765, 0.811765, 0.811765)
  18. Frame.Position = UDim2.new(0.332812518, 0, 0.311621964, 0)
  19. Frame.Size = UDim2.new(0, 443, 0, 282)
  20.  
  21. RippleEffect.Name = "RippleEffect"
  22. RippleEffect.Parent = Frame
  23. RippleEffect.BackgroundColor3 = Color3.new(1, 1, 1)
  24. RippleEffect.BorderColor3 = Color3.new(0.882353, 0.882353, 0.882353)
  25. RippleEffect.Position = UDim2.new(0.273137689, 0, 0.411347508, 0)
  26. RippleEffect.Size = UDim2.new(0, 200, 0, 50)
  27. RippleEffect.Font = Enum.Font.SourceSansLight
  28. RippleEffect.Text = "Press me for Ripple Effect"
  29. RippleEffect.TextColor3 = Color3.new(0, 0, 0)
  30. RippleEffect.TextScaled = true
  31. RippleEffect.TextSize = 14
  32. RippleEffect.TextWrapped = true
  33.  
  34. ImageLabel.Parent = Frame
  35. ImageLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  36. ImageLabel.BackgroundTransparency = 1
  37. ImageLabel.Position = UDim2.new(0.182844251, 0, 0.0283687934, 0)
  38. ImageLabel.Size = UDim2.new(0, 280, 0, 100)
  39. ImageLabel.Image = "rbxassetid://1133305080"
  40.  
  41. TextLabel.Parent = Frame
  42. TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  43. TextLabel.BackgroundTransparency = 1
  44. TextLabel.Position = UDim2.new(0.611738205, 0, 0.23404254, 0)
  45. TextLabel.Size = UDim2.new(0, 200, 0, 50)
  46. TextLabel.Font = Enum.Font.SourceSansLight
  47. TextLabel.Text = "Material Effect"
  48. TextLabel.TextColor3 = Color3.new(0, 0, 0)
  49. TextLabel.TextSize = 26
  50. TextLabel.TextWrapped = true
  51. Circle.Name = "Circle"
  52. Circle.Parent = RippleEffect
  53. Circle.BackgroundColor3 = Color3.new(1, 1, 1)
  54. Circle.BackgroundTransparency = 1
  55. Circle.ZIndex = 10
  56. Circle.Image = "rbxassetid://266543268"
  57. Circle.ImageColor3 = Color3.new(0, 0, 0)
  58. Circle.ImageTransparency = 0.5
  59. local Mouse = game.Players.LocalPlayer:GetMouse()
  60. local function CircleClick(RippleEffect, X, Y)
  61.  
  62. RippleEffect.ClipsDescendants = true
  63.  
  64. local Circle = Circle:Clone()
  65. Circle.Parent = RippleEffect
  66. local NewX = X - Circle.AbsolutePosition.X
  67. local NewY = Y - Circle.AbsolutePosition.Y
  68. Circle.Position = UDim2.new(0, NewX, 0, NewY)
  69.  
  70. local Size = 0
  71. if RippleEffect.AbsoluteSize.X > RippleEffect.AbsoluteSize.Y then
  72. Size = RippleEffect.AbsoluteSize.X*1.5
  73. elseif RippleEffect.AbsoluteSize.X < RippleEffect.AbsoluteSize.Y then
  74. Size = RippleEffect.AbsoluteSize.Y*1.5
  75. elseif RippleEffect.AbsoluteSize.X == RippleEffect.AbsoluteSize.Y then print("This place uses a model by Come0n.") --please do not remove!
  76. Size = RippleEffect.AbsoluteSize.X*1.5
  77. end
  78.  
  79. local Time = 0.5
  80. Circle:TweenSizeAndPosition(UDim2.new(0, Size, 0, Size), UDim2.new(0.5, -Size/2, 0.5, -Size/2), "Out", "Quad", Time, false, nil)
  81. for i=1,10 do
  82. Circle.ImageTransparency = Circle.ImageTransparency + 0.01
  83. wait(Time/10)
  84. end
  85. Circle:Destroy()
  86. end
  87.  
  88.  
  89. RippleEffect.MouseButton1Down:connect(function()
  90. CircleClick(RippleEffect, Mouse.X, Mouse.Y)
  91. end)
  92. local UserInputService,gui,dragging,dragInput,dragStart,startPos = game:GetService("UserInputService"),Frame
  93.  
  94. local function update(input)
  95. local delta = input.Position - dragStart
  96. wait(0.1)
  97. gui.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  98. end
  99.  
  100. gui.InputBegan:Connect(function(input)
  101. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  102. dragging = true
  103. dragStart = input.Position
  104. startPos = gui.Position
  105.  
  106. input.Changed:Connect(function()
  107. if input.UserInputState == Enum.UserInputState.End then
  108. dragging = false
  109. end
  110. end)
  111. end
  112. end)
  113.  
  114. gui.InputChanged:Connect(function(input)
  115. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  116. dragInput = input
  117. end
  118. end)
  119.  
  120. UserInputService.InputChanged:Connect(function(input)
  121. if input == dragInput and dragging then
  122. update(input)
  123. end
  124. end)
Advertisement
Add Comment
Please, Sign In to add comment