Local:
wait(0.3)
local gui = script.Parent.Parent.MainButtons
local dailyButton = gui.dailyButton
local wheelButton = gui.spinButton
local presentButton = gui.presentsButton
local autoFight = gui.autoPunchButton
local tween = game:GetService("TweenService")
local function button_animation(button)
local normalX = button.Size.X.Scale
local noramlY = button.Size.Y.Scale
local enterX = normalX + 0.007
local enterY = noramlY + 0.007
local pressX = normalX - 0.025
local pressY = noramlY - 0.005
button.MouseEnter:Connect(function()
button:TweenSize(UDim2.new(enterX,0,enterY,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)
button.MouseLeave:Connect(function()
button:TweenSize(UDim2.new(normalX,0,noramlY,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)
end
dailyButton.MouseEnter:Connect(button_animation(dailyButton))
So here I have a function for button animation, I want to be able to use this function for each button. It seems to work, but for some reason, I get this error: Attempt to connect failed: Passed value is not a function
how do I fix it?