for i = 1, 10 do wait(0.01) pMenu.loading.ImageTransparency = pMenu.loading.ImageTransparency - .1 end wait(1) for i = 1, 10 do wait(0.01) pMenu.loading.ImageTransparency = pMenu.loading.ImageTransparency + .1 end wait(1) for i = 1, 10 do wait(0.01) pMenu.loading.ImageTransparency = pMenu.loading.ImageTransparency - .1 end wait(1) for i = 1, 10 do wait(0.01) pMenu.loading.ImageTransparency = pMenu.loading.ImageTransparency +.1 end wait(1) for i = 1, 10 do wait(0.01) pMenu.loading.ImageTransparency = pMenu.loading.ImageTransparency - .1 end
Sure! Just use a while
loop. This will keep it going forever,
while true do for i = 1, 10 do wait(0.01) pMenu.loading.ImageTransparency = pMenu.loading.ImageTransparency - .1 end wait(1) for i = 1, 10 do wait(0.01) pMenu.loading.ImageTransparency = pMenu.loading.ImageTransparency + .1 end end
To keep it looping a certain amount of times, just create a value and make it increase after each loop.
local LoopBreak = 0 while true do if LoopBreak == 5 then --Once the LoopBreak reaches 5, it will break the loop. break end for i = 1, 10 do wait(0.01) pMenu.loading.ImageTransparency = pMenu.loading.ImageTransparency - .1 end wait(1) for i = 1, 10 do wait(0.01) pMenu.loading.ImageTransparency = pMenu.loading.ImageTransparency + .1 end LoopBreak = LoopBreak + 1 --Increases the value by one everytime it loops. end