Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Services
- local TweenService = game:GetService("TweenService")
- -- The first parameter of TweenService:Create is the instance we want to tween,
- -- in this case the part, so let's create a variable for it
- local part = script.Parent
- -- The second parameter is TweenInfo. This is a datatype created in a similar
- -- way to Vector3s, using TweenInfo.new.
- local info = TweenInfo.new(
- 1, -- The time we want the tween to last
- Enum.EasingStyle.Linear, -- The style we want the tween to play in
- Enum.EasingDirection.InOut,-- I don't know how to describe this
- 4, -- The amount of times we want the tween to repeat
- true, -- Whether we want the tween to reverse when it's done playing or not
- 0.4 -- The delay time in between each repetition of the tween
- )
- -- The third parameter would be the properties that you want to change, and the
- -- values you want them to be at by the end of the tween
- local properties = {
- Color = Color3.new(1, 0, 0)
- }
- -- Now, we will call TweenService:Create, and it will return (give back) a Tween object
- local tween = TweenService:Create(
- part,
- info,
- properties
- )
- -- Hold on! The tween isn't playing just yet. We need to call tween:Play to make it run.
- tween:Play()
Advertisement
Add Comment
Please, Sign In to add comment