So I'm working with a point light, and I'm trying to get a glowing effect that gradually changes from one color to another.
01 | light = script.Parent; |
02 | r = 0 -- math.random (0,255) |
03 | g = 0 --math.random (0,255) |
04 | b = 255 --math.random (0,255) |
05 | colors = { r,g,b } |
06 |
07 | function UpdateColor () |
08 | light.Color = Color 3. new (r/ 255 ,g/ 255 ,b/ 255 ) |
09 | wait (. 1 ) |
10 | end |
11 |
12 | while wait () do |
13 | print 'stage 1' |
14 | for i = 0 , 50 -r do |
15 | if r < 255 then |
Any and all help will be appreciated.
You can, the problem is that the statement is not being executed because of
1 | for i = 0 , 50 -b do |
Since b = 255, 50 - 255 is -205, so for 0,-205 is not going to execute because the default step is 1
It is going to -205 because the variable b = 255...........