October 12, 20196 yr Hi all, And this week's question is: If I am testing a button state and I am using x = ipc.testbutton(2, 11) and as the library says, the return will be either TRUE or FALSE, would I then put... if (x == TRUE) then or if (x == "TRUE") then or, am I asking the wrong question? Here's the whole chunk... function switchcon () x = ipc.testbutton(2, 11) if (x == TRUE) then function fuelchecka () function fuelcheckb () end if (x == FALSE) then sound.stop("Warning_Fuel_Tone") sound.stop("Warning_Fuel") end end Thanks in advance, G
October 12, 20196 yr LUA is case sensitive. Use if val == true then or if val == false then Edited October 12, 20196 yr by ScotFlieger Andrew Gransden Scotland, UK LINDA Support/Developer - VATSIM and BAVirtual - Airbus Flyer i7 1TB SSD GTX980 - FSX/P3D - Aerosoft Airbus A318/A319/A320/A321 - FS2Crew
October 12, 20196 yr Author Thank you once again, that was the issue, lower case not caps. It is expressed as caps in the .lua library document so that's my excuse this time around. Thanks again, G
Archived
This topic is now archived and is closed to further replies.