Solved Lua issue

Discussion in 'Mod Support' started by Stoat Muldoon, Feb 19, 2017.

  1. Stoat Muldoon

    Stoat Muldoon
    Expand Collapse
    BeamNG Team

    Joined:
    Jun 21, 2013
    Messages:
    320
    Hi all, I'm having an issue with a very simple bit of lua for a plane, literally just an if/else statement that changes a value from 0 to 1 and back on a condition. The lua file is attached to the post. This is the error I'm getting:

    From what a bit of googling has told me, I need to have two = signs after the "if" line, and I do, but I still have the same issue. I have no experience with lua and very little with coding in general, so I'm assuming I've done something stupid but I'd be grateful if someone could point out exactly how stupid. Thanks :p
     

    Attached Files:

  2. bidwars

    bidwars
    Expand Collapse

    Joined:
    Sep 23, 2014
    Messages:
    146
    This line
    if electrics.values['gear'] = 0 then

    needs to be
    if electrics.values['gear'] == 0 then
     
  3. Stoat Muldoon

    Stoat Muldoon
    Expand Collapse
    BeamNG Team

    Joined:
    Jun 21, 2013
    Messages:
    320
    Ok, I'm officially dumb as a fencepost. I was certain I had made that change, and made this thread because it still wasn't working. I'd put the '==' on a backup version of the file in a different folder. Thank you though. It works now :oops:
     
  4. iheartmods

    iheartmods
    Expand Collapse

    Joined:
    Aug 8, 2012
    Messages:
    1,483
    lol, we all have those moments as modders.
     
    • Like Like x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice