local H=script.Parent local G=Color3.fromRGB local n=UDim2.new repeat wait()until game.Players.LocalPlayer local Q=game.Players.LocalPlayer local O=Q:GetMouse()H.ClipsDescendants=true H.AutoButtonColor=false function tweenInRipple(H)spawn(function()local G=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local Q=H local O=TweenInfo.new(TimeLength,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0)local Y={Size=n(0,PixelSize,0,PixelSize)}local u=G:Create(Q,O,Y)u:Play()end)end function fadeOutRipple(H)spawn(function()local G=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local n=H local Q=TweenInfo.new(FadeLength,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0)local O={ImageTransparency=1}local Y=G:Create(n,Q,O)Y:Play()wait(FadeLength+.1)H:Destroy()end)end H.MouseButton1Down:Connect(function()local G=false local n=script.Circle:Clone()n.Parent=H n.ZIndex=H.ZIndex+1 n.ImageColor3=RippleColor n.ImageTransparency=RippleTransparency tweenInRipple(n)H.MouseButton1Up:Connect(function()if G==false then G=true fadeOutRipple(n)end end)wait(4)G=true fadeOutRipple(n)end)
-- Script Below

local frame = script.Parent
local rgb = Color3.fromRGB
local ud2 = UDim2.new
repeat
	wait()
until game.Players.LocalPlayer
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()

frame.ClipsDescendants = true
frame.AutoButtonColor = false

function tweenInRipple(ripple)
	spawn(function()
		local TweenService = game:GetService("TweenService")
		local Part = ripple
		local Info = TweenInfo.new(TimeLength, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
		local Goals = {
			Size = ud2(0, PixelSize, 0, PixelSize),
		}
		local Tween = TweenService:Create(Part, Info, Goals)
		Tween:Play()
	end)
end

function fadeOutRipple(ripple)
	spawn(function()
		local TweenService = game:GetService("TweenService")
		local Part = ripple
		local Info = TweenInfo.new(FadeLength, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
		local Goals = {
			ImageTransparency = 1,
		}
		local Tween = TweenService:Create(Part, Info, Goals)
		Tween:Play()
		wait(FadeLength + 0.1)
		ripple:Destroy()
	end)
end

frame.MouseButton1Down:Connect(function()
	local done = false
	local ripple = script.Circle:Clone()
	ripple.Parent = frame
	ripple.ZIndex = frame.ZIndex + 1
	ripple.ImageColor3 = RippleColor
	ripple.ImageTransparency = RippleTransparency
	tweenInRipple(ripple)
	frame.MouseButton1Up:Connect(function()
		if done == false then
			done = true
			fadeOutRipple(ripple)
		end
	end)
	wait(4)
	done = true
	fadeOutRipple(ripple) -- if it doesnt detect that it was unselected
end)
