function init()
    light = FindLights("stoplight")
    light_shape = {}
    for i = 1, #light do
        light_shape[i] = GetLightShape(light[i])
        SetTag(light_shape[i], "invisible")
    end
end

function update()
    for i = 1, #light do
        if IsLightActive(light[i]) then
            for j = 1, #light_shape do
                RemoveTag(light_shape[j], "invisible")
            end
        else
            for j = 1, #light_shape do
                SetTag(light_shape[j], "invisible")
            end
        end
    end
end