I have a button in a ScreenGui, and I want its BackgroundTransparency to change from its current BackgroundTransparency to .9 when my mouse enters the button, and when it leaves, it returns to its first BackgroundTransparency. Here is what i got:
b = script.Parent.BackgroundTransparency
script.Parent.MouseEnter:connect(function()
for i = 1,.9,-.25 do
game:GetService("RunService").RenderStepped:wait()
script.Parent.BackgroundTransparency = i
end
end)
script.Parent.MouseLeave:connect(function()
for i = b,1,.25 do
game:GetService("RunService").RenderStepped:wait()
script.Parent.BackgroundTransparency = i
end
end)
Nothing in output either,

3 comments
The only thing is, is that 'b' will be the same value throughout since it's only evaluated once at the start
Yes, that's precisely what would be wanted. It ranges between (b) transparency and completely invisible. There's no reason for that to change throughout the script since you would want it to be the same.
What I had assumed is that he wanted it loop the Transparency from what the current Transparency is, not a constant value