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




















































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)
