Search the Community
Showing results for tags 'scripts'.
Found 1 result
Hey guys, I need some help with my lua script which reads a FSUIPC offset. Its not working as intended and I'm not sure why Essential I need a message to be displayed when I switch the Landing Lights ON. But I only want this to happen when I am airborne, not on the ground. To check this I read the FSUIPC offset 0366 to see if the plane is airborne. However I must have coded the ipc.readSW(offset) incorrectly, because the wrong message is being displayed even when I am on the ground. Here is the code: function runMessage(event, param) local gnd = ipc.readSW(0366) if (gnd == 1) then ipc.display("you are on the ground and the offset was read correctly", 1, 0 ) return end if (gnd == 0) then ipc.display("Landing Lights ON: .. message here", 1, 0 ) return end end event.control(66059, "runMessage") -- lights on Thanks