I've been a bit stuck on how to cleanly script BackgroundTransparency without doing this.
script.Parent.Frame.BackgroundTransparency = 0.1 wait(0.05) script.Parent.Frame.BackgroundTransparency = 0.2 -- And on and on, its stressful and unclean.
How can you script it to where it makes it cleanly play through the Transparency Frames?
Thank you for you're time.
You can use tweens to smoothly animate properties and get the result you want.
local TweenService = game:GetService("TweenService") local object = script.Parent.Frame local TweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out) local goals = { BackgroundTransparency = 1 } local tween = TweenService:Create(object, TweenInfo, goals) tween:Play()
You can just use for loop, which will repeat script needed amount of time
Here's the code:
for i = 1,9 do wait(0.05) script.Parent.Frame.BackgroundTransparency = tonumber("0."..i) -- convert 9 to 0.9 end
And that's just it!