hi there
I am looking for a way to turn ON an output and turn it OFF after 5 seconds.
I managed to write a lua code in the signal script that basically turn ON and OFF an output but now i am struggling to implement a delay
-- code
local inst = mc.mcGetInstance()
local hsig = mc.mcSignalGetHandle(inst,mc.ISIG_INPUT1)
local ISigFDBK = mc.mcSignalGetState(hsig)
local hsignal = mc.mcSignalGetHandle(inst,mc.OSIG_OUTPUT5)
local OSigFDBK = mc.mcSignalGetState(hsignal)
if (ISigFDBK == 0)then
mc.mcSignalSetState(hsignal,1)
else
mc.mcSignalSetState(hsignal,0)
end