Issues with LUA scripts

Hello,

I'd been working on a LUA script for Runway and Taxilights. This is the script:

!lua
local visibility = varget("O:Weather.AmbientVisibility", "Meters")

if visibility < 8001 then
varset("T:DiffuseTexture","String","lights_lm.dds")
varset("T:EmissiveTexture","String","lights_lm.dds")
else
varset("T:DiffuseTexture","String","lights.dds")
varset("T:EmissiveTexture","String","lights_lm.dds")
end


I have this simple script that basically works when visibility is less than 8001 meters.

When I use default or less complex aircraft looks like these:





No problem with default aircraft, but when I choose PMDG or even the Aerosoft Airbus this situation happens:





Someone encountered this issue? How can I solve it? or should I choose another option for my lights? Thanks in advance

Regards,
Walter Almaraz
 
Top