local TweenService = game:GetService("TweenService")
Defines how the tween behaves.
local TweenInfo = TweenInfo.new(
Time, -- Duration (in seconds)
EasingStyle, -- How the tween progresses (Linear, Quad, Bounce, Elastic, etc.)
EasingDirection,-- In, Out, InOut
RepeatCount, -- Times to repeat (-1 = infinite)
Reverses, -- true/false (reverse after finishing?)
DelayTime -- Delay before starting
)
local info = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)
local part = workspace.Part
local goal = {
Position = Vector3.new(0, 10, 0), -- target position
Color = Color3.fromRGB(255, 0, 0) -- target color
}
local tween = TweenService:Create(part, info, goal)
tween:Play()
tween.Completed:Connect(function(status)
print("Tween finished with status:", status) -- "Completed" or "Canceled"
end)