yes, it works fine. But since its a script it will only run in play the game.
Here is the code back without the lprints which will slow it down.
- Code: Select all
intensity={}
intensity[0] = 1.1
intensity[1] = 0.9
intensity[2] = 1.2
intensity[3] = 0.8
intensity[4] = 1.1
intensity[5] = 0.8
intensity[6] = 1.3
intensity[7] = 0.8
intensity[8] = 1.1
intensity[9] = 1.18
intensity[10] = 0.9
intensity[11] = 1.3
intensity[12] = 0.7
intensity[13] = 1.2
intensity[14] = 0.9
count = 0
firstTimer = 0
obj = 0;
function onInit( objID )
--sky.lprint("script is active");
obj = objID
difR,difG,difB = light.getDiffuseColor(obj)
rand = math.random(1,100)
firstTimer = 1
time.startTimer( 1, obj, 100 );
-- sky.lprint("init complete");
end
function onTimer( )
-- sky.lprint("timer.. running");
if(firstTimer == 0)then
if(count == 15)then
count = 0
else
value = intensity[count]
light.setIntensity(obj,value)
count = count + 1
end
else
time.stopTimer( 1, obj )
firstTimer = 0
time.startTimer( 1, obj, 100 )
end
end
function onStop( )
time.stopTimer( 1, obj )
light.setDiffuseColor(obj,difR,difG,difB)
end
If you cant see the light, make sure you dont have overpowering sunlight as you wont see smaller lights unless slightly darker.
Also make sure the point light is encompassing models
Hope this helps