I have this script to make a loading screen, and it has a for loop wich sets the imagelabel's imagetransparency from 1 to 0 and then from 0 to 1. The problem is, it waits 0.4 seconds before changing, stops on -0.8, waits about 2 seconds and just doesn't work anymore. This is the script:
local Gui = script:WaitForChild("LoadingGui")
local player = game.Players.LocalPlayer
local backG = Gui.Back
local FranXXicon = backG.Icon
wait(6)
for i = -1,0,0.1 do
wait(0.4)
if i == -1 then
FranXXicon.ImageTransparency = 1
print(i)
elseif i == -0.9 then
FranXXicon.ImageTransparency = 0.9
print(i)
elseif i == -0.8 then
FranXXicon.ImageTransparency = 0.8
print(i)
elseif i == -0.7 then
FranXXicon.ImageTransparency = 0.7
print(i)
elseif i == -0.6 then
print(i)
FranXXicon.ImageTransparency = 0.6
elseif i == -0.5 then
print(i)
FranXXicon.ImageTransparency = 0.5
elseif i == -0.4 then
print(i)
FranXXicon.ImageTransparency = 0.4
elseif i == -0.3 then
print(i)
FranXXicon.ImageTransparency = 0.3
elseif i == -0.2 then
print(i)
FranXXicon.ImageTransparency = 0.2
elseif i == -0.1 then
print(i)
FranXXicon.ImageTransparency = 0.1
elseif i == -1.3877787807814e-16 then
print(i)
FranXXicon.ImageTransparency = 0
end
end
for i = 0,1,0.1 do
if i == 0.1 then
print(i)
FranXXicon.ImageTransparency = 0.1
elseif i == 0.2 then
print(i)
FranXXicon.ImageTransparency = 0.2
elseif i == 0.3 then
print(i)
FranXXicon.ImageTransparency = 0.3
elseif i == 0.4 then
print(i)
FranXXicon.ImageTransparency = 0.4
elseif i == 0.5 then
print(i)
FranXXicon.ImageTransparency = 0.5
elseif i == 0.6 then
print(i)
FranXXicon.ImageTransparency = 0.6
elseif i == 0.7 then
print(i)
FranXXicon.ImageTransparency = 0.7
elseif i == 0.8 then
print(i)
FranXXicon.ImageTransparency = 0.8
elseif i == 0.9 then
print(i)
FranXXicon.ImageTransparency = 0.9
elseif i == 1 then
print(i)
FranXXicon.ImageTransparency = 1
end
end

3 comments
Never tought you could use tweening to just change properties that aren't position, but ima try it.
I edited my post to link to the documentation for TweenService:Create
Yes, it's working. I made two separate tweens, one to fade in and another to fade out.