-- Step 1: Import the necessary modules
local TweenService = game:GetService("TweenService")
-- Step 2: Reference to the part you want to tween
local part = script.Parent
-- Step 3: Define the properties you want to change during the tween
local endPosition = Vector3.new(0, 10, 0)
local endSize = Vector3.new(5, 5, 5)
local endColor = Color3.new(1, 0, 0)
-- Step 4: Create a new tween info object with the desired duration and easing style
local tweenInfo = TweenInfo.new(
2, -- duration
Enum.EasingStyle.Quad, -- easing style
Enum.EasingDirection.Out, -- easing direction
0, -- repeat count (0 for no repeat)
false, -- reverses the tween if true
0 -- delay
)
-- Step 5: Create keyframes for each property you want to tween
local positionTween = TweenService:Create(
part,
tweenInfo,
{Position = endPosition}
)
local sizeTween = TweenService:Create(
part,
tweenInfo,
{Size = endSize}
)
local colorTween = TweenService:Create(
part,
tweenInfo,
{Color = endColor}
)
-- Step 6: Connect the keyframes to the Completed event to handle completion
positionTween.Completed:Connect(function()
print("Position tween completed")
end)
sizeTween.Completed:Connect(function()
print("Size tween completed")
end)
colorTween.Completed:Connect(function()
print("Color tween completed")
end)
-- Step 7: Play the tweens
positionTween:Play()
sizeTween:Play()
colorTween:Play()