Is there a way to avoid doing this?

I’m curious if this works for TagService or not, but how do I avoid repetition like this for Tweens?

local TweenService = game:GetService("TweenService")
local Tweeninfo = TweenInfo.new(
	1, 
	Enum.EasingStyle.Linear, 
	Enum.EasingDirection.In, 
	0, 
	false, 
	0
)
local FadeIN = TweenService:Create(PlrCoolDownGui.cooldownframe, Tweeninfo, {BackgroundTransparency = 0})
local FadeIN2 = TweenService:Create(PlrCoolDownGui.cooldownframe.UIStroke, Tweeninfo, {Transparency = 0})
local FadeIN3 = TweenService:Create(PlrCoolDownGui.cooldownframe.CooldownAmount, Tweeninfo, {TextTransparency = 0})
local FadeIN4 = TweenService:Create(PlrCoolDownGui.cooldownframe.CooldownAmount.UIStroke, Tweeninfo, {Transparency = 0})

You can use CanvasGroup’s GroupTransparency property and tween it.

You might want to research what I exactly mean with the link I gave below:

1 Like

Since there’s repetition within the lines of code, what you could do is to use functions with the necessary variables in its parameters. Then you would run the function whenever you need to use Tweens.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.