Hello Everyone, i hope you guys have a nice day!
So i was making tweenService on the button, i want it to look kinda “satisfying”
So i did but from line 68
the tween isnt make the button small.
Code:
local Tween = game:GetService("TweenService")
local Button = script.Parent
local Text = script.Parent.TextLabel
local Image = script.Parent.ImageLabel
local IB = script.Parent.ImageButton
local Info = TweenInfo.new(0.05, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)
local Goals = {
["Size"] = UDim2.new(0, 219, 0, 93)
}
local Goals2 = {
["Size"] = UDim2.new(0, 174, 0, 88)
}
local Goals3 = {
["Size"] = UDim2.new(0, 90, 0, 103)
}
local Goals4 = {
["Size"] = UDim2.new(0, 219, 0, 93)
}
local function playTween()
local ButtonS = Tween:Create(Button, Info, Goals)
local TextS = Tween:Create(Text, Info, Goals2)
local ImageS = Tween:Create(Image, Info, Goals3)
local IBS = Tween:Create(IB, Info, Goals4)
task.wait(0.1)
ButtonS:Play()
TextS:Play()
ImageS:Play()
IBS:Play()
end
Button.MouseEnter:Connect(playTween)
local Info2 = TweenInfo.new(0.05, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false, 0)
local GoalsS = {
["Size"] = UDim2.new(0, 209, 0, 82)
}
local GoalsS2 = {
["Size"] = UDim2.new(0, 153, 0, 78)
}
local GoalsS3 = {
["Size"] = UDim2.new(0, 80, 0, 87)
}
local GoalsS4 = {
["Size"] = UDim2.new(0, 209, 0, 82)
}
local function playTween2()
local ButtonS = Tween:Create(Button, Info2, GoalsS)
local TextS = Tween:Create(Text, Info2, GoalsS2)
local ImageS = Tween:Create(Image, Info2, GoalsS3)
local IBS = Tween:Create(IB, Info2, GoalsS4)
task.wait(0.1)
ButtonS:Play()
TextS:Play()
ImageS:Play()
IBS:Play()
end
Button.MouseLeave:Connect(playTween2)
local Info3 = TweenInfo.new(0.01, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0)
local GoalsSS = {
["Size"] = UDim2.new(0, 189, 0, 72)
}
local GoalsSS2 = {
["Size"] = UDim2.new(0, 133, 0, 78)
}
local GoalsSS3 = {
["Size"] = UDim2.new(0, 75, 0, 80)
}
local GoalsSS4 = {
["Size"] = UDim2.new(0, 189, 0, 72)
}
local function playTween3()
local ButtonS = Tween:Create(Button, Info3, GoalsSS)
local TextS = Tween:Create(Text, Info3, GoalsSS2)
local ImageS = Tween:Create(Image, Info3, GoalsSS3)
local IBS = Tween:Create(Image, Info3, GoalsSS4)
task.wait(0.01)
ButtonS:Play()
TextS:Play()
ImageS:Play()
IBS:Play()
end
Button.MouseButton1Click:Connect(playTween3)
and here is the footage:
this is what it should do: