Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function addButtons()
- local example = Frame.example
- local X,Y = 10,10
- for i,v in pairs(things) do
- if X > 550 then
- X = 10
- Y = Y + 30
- end
- local k = example:Clone()
- k.Text = v.__name
- k.MouseButton1Click:Connect(v.__run)
- k.Visible = true
- k.Size = UDim2.new(0,0,0,0)
- k.Position = UDim2.new(0,X,0,Y)
- k.Parent = Frame.ScrollingFrame
- k:TweenSize(example.Size,'InOut','Sine',.5)
- local script = Instance.new('LocalScript',k)
- local currentCircle
- local burst = false
- local function makeRipple(x, y, obj)
- local img = Instance.new("ImageLabel")
- currentCircle = img
- img.BackgroundTransparency = 1
- img.BorderSizePixel = 0
- img.Image = "rbxasset://textures/whiteCircle.png"
- img.ImageTransparency = 0.25
- img.ImageColor3 = Color3.new(1, 1, 1)
- img.Size = UDim2.new(0, 0, 0, 0)
- img.Position = UDim2.new(0, x - obj.AbsolutePosition.X, 0, y + -36 - obj.AbsolutePosition.Y)
- img.Parent = obj
- img:TweenSize(UDim2.new(0, 600, 0, 600), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 2, true)
- img.ImageColor3 = Color3.fromRGB(34, 178, 255)
- img.AnchorPoint = Vector2.new(0.5, 0.5)
- img.ZIndex = obj.ZIndex
- end
- local fadeOut = function(obj)
- local tweenService = game:GetService("TweenService")
- local info = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)
- local goal = {ImageTransparency = 1}
- local tween = tweenService:Create(obj, info, goal)
- tween:Play()
- wait(0.75)
- obj:Destroy()
- end
- local deb, op = false, false
- script.Parent.MouseButton1Down:Connect(function(x, y)
- burst = true
- makeRipple(x, y, script.Parent)
- end)
- script.Parent.MouseButton1Up:Connect(function()
- local e = currentCircle
- burst = false
- for i = 0.1, 1, 0.045 do
- e.ImageTransparency = i
- wait()
- end
- e:Destroy()
- end)
- script.Parent.MouseLeave:Connect(function()
- for i, v in pairs(script.Parent:GetChildren()) do
- if v ~= currentCircle and not v:IsA("LocalScript") then
- fadeOut(v)
- end
- end
- end)
- X = X + 140
- table.insert(buttons,k)
- wait(.1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement