I’m trying to add to the transparency of all the frames inside of this frame without writing it over and over again, but it doesn’t seem to work. If I keep the last two lines, it’s extremely laggy but still doesn’t do anything. Help?
for i, v in pairs(CurrentRoleEquipment:GetChildren()) do
if v:IsA("Frame") then
while true do
v.BackgroundTransparency = v.BackgroundTransparency - 0.05
task.wait()
repeat
until v.BackgroundTransparency == 0.6
end
end
end
if v:IsA("Frame") then
repeat
v.BackgroundTransparency = v.BackgroundTransparency - 0.05
task.wait()
until v.BackgroundTransparency == 0.6
end
also I’m guessing if you want them all to decrease at once you can learn how to use a CanvasGroup or script it manually.
if v:IsA("Frame") then
task.defer(function()
repeat
v.BackgroundTransparency = v.BackgroundTransparency - 0.05
task.wait()
until v.BackgroundTransparency == 0.6
end)
end
task.defer allows a function to run alongside the rest of the script so it doesnt wait for the UI to fade.
But in conclusion you could use TweenService to automate all of this