This in theory (can't test it as i'm at work) should do what you need. You need a red and a blue light source and the following two scripts.
Drop a red light source and apply the light_flash.lua script. It will flash on and off when you test it (you may want to adjust the time in line 7 but make sure both scripts have the same delay so they flash evenly)
light_flash.lua
local delay = {}
local init_delay = {}
local on = {}
function light_flash_init(e)
--change delay here to adjust flash timing
delay[e] = 250
init_delay[e] = delay[e]
on[e] = 0
end
function light_flash_main(e)
if GetTimer(e) > delay[e] then
if on[e] == 0 then
on[e] = 1
ShowLight(e)
else
on[e] = 0
HideLight(e)
end
delay[e] = GetTimer(e) + init_delay[e]
end
end
Drop a red light source and apply the light_flash2.lua script. It will flash on and off when you test it (you may want to adjust the time in line 7, but make sure both scripts have the same delay so they flash evenly)
light_flash2.lua
local delay = {}
local init_delay = {}
local on = {}
function light_flash2_init(e)
--change delay here to adjust flash timing
delay[e] = 100
init_delay[e] = delay[e]
on[e] = 1
end
function light_flash2_main(e)
if GetTimer(e) > delay[e] then
if on[e] == 0 then
on[e] = 1
ShowLight(e)
else
on[e] = 0
HideLight(e)
end
delay[e] = GetTimer(e) + init_delay[e]
end
end
Note: I may have added one too many end commands at the bottom of the script, so if it says there's an unexpected end command when you run it just delete the last end in each script.
I'm still learning LUA at the moment so I may be wrong, apologies in advance if it doesn't work, also there may be a way to do it in a single script and single light source by alternating colours instead of turning it on and off, but i'm not sure how to do that.