Ahh, I see the problem.
Lines 8 and 9 should be lights[ e ].num instead of lightNum
-- LUA Script - precede every function and global member with lowercase name of script + '_main'
local lights = {}
local delay = 50
function light_fire_init(e)
local lnum = GetEntityLightNumber( e )
if lnum > 0 then
local lx, ly, lz = GetLightPosition( lnum)
local lr, lg, lb = GetLightRGB( lnum )
lights[ e ]= { num = lnum, x = lx, y = ly, z = lz, r = lr, g = lg, b = lb }
end
end
function light_fire_main(e)
if GetTimer(e) > delay then
local l = lights[ e ]
if l == nil then return end
SetLightPosition ( l.num, l.x + math.random(-1,1), l.y + math.random(-3,3), l.z + math.random(-1,1) )
SetLightRGB ( l.num, l.r, l.g + math.random(-10,4), l.b )
SetLightRange ( l.num, (150 + math.random(-20,20)) )
StartTimer(e)
end
end
There, that's better.
Edited to add, got there eventually, I really need to learn how to spell.
Been there, done that, got all the T-Shirts!