✓ Accepted answer
Problem
Declaring the variable "a" in the second loop is saving the object's reflectance as a number - it is not holding a reference to the reflectance property.
When is it appropriate to declare a variable then?
Instead of just creating a variable that holds a number, and changing that number (which evidently will not update the property), you should create one referencing the object you're trying to change - to shorten your code and make it look nicer. Here's an example:
local parent = script.Parent
repeat wait(0.1)
parent.Reflectance = parent.Reflectance + 0.1
until parent.Reflectance >= 1
This same logic applies with anything else you're trying to change. You want to create a reference to another reference - not it's value if you are to change it.
6 comments
It has to do with adding decimals in Lua. If you add a whole number to a on line 4, and divide by 10, it should fix the problem.
Here's a question that was asked awhile ago that relates to your probelm https://scriptinghelpers.org/questions/29524/trouble-with-numeric-for-loop-and-step-variant
So instead of "+0.1" you are saying that I should replace it with "+(1/10)"?
Yeah. This hasn't been tested, but that would be the first thing I would test.
okay, scratch that =3
I tested it and it did not work either.