1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Stuck, Having problems with creating your mod? Let us help you: Mod Support

Unsolved Scenario .lua file-Help!

Discussion in 'Mod Support' started by The Gas Station, Mar 10, 2018.

  1. The Gas Station

    The Gas Station
    Expand Collapse

    Jul 14, 2016
    So I've got a pretty complex scenario, I got almost everything working, except from the "win" condition.
    What I need is a .lua file that will "count" whenever you've passed through specific checkpoints (not every checkpoint- only specific ones), and after you passed through a defined number of them, it will send a "success" to the game (you win).
    Problem is, I don't know .lua at all.
    If you know a bit of .lua, and can help by explaining what functions I need to use, or by sending a link that will help me learn Beamng lua basics, or even better- if you could build a template file, I'd really appreciate that.
  2. Aerotactics

    Expand Collapse

    Dec 23, 2015
    Check out the Tanker Delivery LUA script for reference, but I think you could do (this is abbreviated):

    local count = 0

    Onplayerentercheckpoint {
    if(count == somenumber)