Im new to scripting and am trying to create a sphere that continuously fades in and out. I have it working with this script although the transparency will go up to 1.1 and -0.1 and I cant figure out why. Heres what I have.
sphere = script.Parent
transparency = 0
fadeOut = true
while true do
if transparency <= 0 then
fadeOut = true
elseif transparency >= 1 then
fadeOut = false
end
if fadeOut then
transparency = transparency + 0.1
sphere.Transparency = transparency
else -- fadein
transparency = transparency - 0.1
sphere.Transparency = transparency
end
wait(1)
end
