local Block = script.Parent
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
0.5,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out
)
local tweenFadeOut = TweenService:Create(Block, tweenInfo, {Transparency = 1})
local tweenFadeIn = TweenService:Create(Block, tweenInfo, {Transparency = 0})
tweenFadeOut:Play() -- fade out
tweenFadeOut.Completed:Wait() -- wait for it to finish
tweenFadeIn:Play() -- fade in
tweenFadeIn.Completed:Wait()
local TweenService = game:GetService(“TweenService”)
local part = workspace:WaitForChild(“Block”) --your block
local tweenInfo = TweenInfo.new(
1, --seconds to animate
Enum.EasingStyle.Sine,
Enum.EasingDirection.InOut,
0, – loop forever – how many loops you want of fading in and out
true, – reverse after each play – true if you want it to reverse, example 0 transparency to 1 then back to 0
0 – no delay – delay between reverse
)
local tween = TweenService:Create(part, tweenInfo, {Transparency = 1}) – amount you want to go down to
tween:Play()
local TweenService = game:GetService(“TweenService”)
local tweenInfo = TweenInfo.new(
1, -- Seconds to animate
Enum.EasingStyle.Linear,
Enum.EasingDirection.InOut,
0, -- No repeats
true, -- Reverse back to initial value after finishing tween to transparency=1
5 -- 5 second delay between reverse
)
local tween = TweenService:Create(Block, tweenInfo, {
Transparency = 1 -- End goal
})
tween:Play()
Here’s the same thing but formatted correctly. (Also recommended to use task.wait() instead of wait() which is pretty much deprecated at this point)