Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is it possible to shorten the loops?

Asked by 4 years ago

Is there a way I can make this shorter? Is it possible? I tried adding an extra loop but makes it more difficult to read.

local MonsterText = script.Parent.Monster
local ThreatText = script.Parent.Threat
local Background = script.Parent

wait(3)

for i = 1, 0, -0.05 do
    MonsterText.TextTransparency = i
    wait(0.01)
end

wait(2)

for i = 1, 0, -0.05 do
    ThreatText.TextTransparency = i
    wait(0.01)
end

wait(2)

for i = 0, 2, 0.05 do
    MonsterText.TextTransparency = i
    wait(0.01)
end

wait(2)

for i = 0, 2, 0.05 do
    ThreatText.TextTransparency = i
    wait(0.01)
end

wait(2)

for i = 0, 2, 0.05 do
    Background.BackgroundTransparency = i
end
0
By shorter do you mean have the loop run at a quicker speed? Loughdough 291 — 4y
0
To shorten the code I mean. xinoireX 2 — 4y

Answer this question