Jump to content
The simFlight Network Forums

Help - Lua Error


Recommended Posts

I keep getting this error:

********* LUA: "MSFS_Lua" Log [from FSUIPC version 7.4.1] *********
   157562 System time = 22/02/2024 18:32:10, Simulator time = 18:32:08 (23:32Z)
   157562 LUA: beginning "C:\FSUIPC7\MSFS_Lua.lua"
   157562 *** LUA Error: C:\FSUIPC7\MSFS_Lua.lua:15: '=' expected near 'else'
   157593 >>> Thread forced exit (ipc.exit or os.exit) <<<
   157593 System time = 22/02/2024 18:32:10, Simulator time = 18:32:08 (23:32Z)
********* LUA execution terminated: Log Closed *********

For the life of me, I cannot seem to find the correction. I've looked at the error online (it stated the if statement was in error ????). 

I've used aircraft == typeac1,  aircraft ~= typeac1 or aircraft == "DA62". Please help, you are the only one that I know to ask.

I'm using this module to communicate different aircraft controls and instruments to use keypads, Alpha and Bravo devices. Addon aircraft are not consistent with the use of controls, events and input events. 



Link to comment
Share on other sites

On line 14 (and 18) you have
when it should be

It is a function and you are missing the brackets, so it is being interpreted as a variable, and thereofore an assignment is expected, hence the error (i,e, as its a variable, it needs to be followed by an '=' sign, but it is followed by 'else' instead).

Link to comment
Share on other sites

Just now, DaveSCUSA said:

Sometimes very confusing and not obvious. Still becoming used to Lua.

When you get a lua error, the line number is given - just remember to check the previous line as well as the one given, as the error may be there (or even before!).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.