this is what I've so far:
local U = require "scriptbank\\utillib"
light = {}
bulb_name = {}
bulb_id = nil or 0
local lightNum = 0
local xv1, yv1, zv1 = 0,0,0
local x, y, z = 0,0,0
local posx, posy, posz = 0,0,0
local rotx, roty, rotz = 0,0,0
local rotateY = 0
local plrdist = 0
function light_follow_bulb_init(e)
end --init
function light_follow_bulb_main(e)
plrdist = GetPlayerDistance(e)
obj = g_Entity[e]['obj']
for i = 1, g_EntityElementMax, 1 do
if g_Entity[i] ~= nil then
if g_Entity[i] ~= e then
if bulb_name[i] == "bulb_ani1" then
if bulb_id == nil or bulb_id == 0 then bulb_id = i end
x, y, z = GetLightPosition( light[i] )
xv, yv, zv = GetLightAngle( light[i] )
lightNum = GetEntityLightNumber( i )
rotateY = rotateY + g_Entity[i]['angley']
if rotateY >= 360 then rotateY = rotateY - 360 end
if plrdist < 200 then
for i = 1,10000,1 do
posx, posy, posz, rotx, roty, rotz = GetObjectPosAng( obj )
SetLightPosition ( lightNum, posx, posy - 10, posz ) --200
SetLightAngle( lightNum, rotx, roty, rotz )
range = GetLightRange ( lightNum )
SetLightRange ( lightNum, range+i )
end
end
end
end
end
end
end --main
function round(num, idp)
local mult = 10^(idp or 0)
return math.floor(num * mult + 0.5) / mult
end
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4