roblox tweenservice
Sure! Here is a response without your personal words at the beginning and end of your reply:
- Import the TweenService module by using the require function:
local TweenService = game:GetService("TweenService")
- Create a new tween by using the Create function of TweenService:
local tweenInfo = TweenInfo.new(time, easingStyle, easingDirection, repeatCount, reverses, delayTime)
local tween = TweenService:Create(instance, tweenInfo, goals)
- Play the tween on an instance by using the Play function:
tween:Play()
- Pause the tween using the Pause function:
tween:Pause()
- Resume the paused tween using the Resume function:
tween:Resume()
- Cancel the tween using the Cancel function:
tween:Cancel()
- Connect a function to the Completed event of the tween to execute code when the tween is finished:
tween.Completed:Connect(function()
-- Code to execute when the tween is finished
end)