So I bet more than half of you use windows and in windows you know the button click effect. So I made it for roblox.
With the code you need to make a frame called “Effect” (without quotation marks) with a UICorner with Size “1,0”
local MouseClickEffect = {}
local function Tween(OBJInstance,Goal,Duration)
local ts = game:GetService("TweenService")
local T = ts:Create(OBJInstance,TweenInfo.new(Duration),Goal)
T:Play()
end
function MouseClickEffect.AddEffect(GUIInstance,Mouse,Duration)
if GUIInstance.ClipsDescendants == false then
GUIInstance.ClipsDescendants = true
end
if GUIInstance.AutoButtonColor == true then
GUIInstance.AutoButtonColor = false
end
local MX,MY = Mouse.X,Mouse.Y
local ASX,ASY = GUIInstance.AbsoluteSize.X,GUIInstance.AbsoluteSize.Y
local XScale = (- ASX + MX) / ASX
local YScale = ((- ASY + MY) / ASY)-3
local effect = script.Effect:Clone()
effect.Parent = GUIInstance
effect.Position = UDim2.fromScale(XScale,YScale)
local maxsize = math.max(ASX,ASY)*3
effect:TweenSize(UDim2.fromOffset(maxsize,maxsize),"Out","Sine",Duration)
Tween(effect,{BackgroundTransparency = 1},Duration)
wait(Duration)
effect:Destroy()
end
return MouseClickEffect
just paste this baby into a module script and you will be ready to go.
PROOF IT WORKS!
I hope you all liked this if not please don’t report this was my first Community Resource (I think)
- Useful
- Useful for other (cause I know how to make)
- Useful for others but I don’t need it
- Not Useful at all
0 voters