1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.32 Bug Reporting thread
    Solutions and more information may already be available.

lua questions

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by crashmaster, Apr 22, 2017.

  1. crashmaster

    crashmaster
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    1,812
    Is there a way to "read" how much rpm your engine is at in-game from lua?
    if so how would that be written?

    The thing is im trying lua a bit and i wanna test a bunch of things like this. if everything goes well this will bring a few future features in one of my next mod.
    Thanks for your time.
     
  2. thomatoes50

    thomatoes50
    Expand Collapse
    BeamNG Team

    Joined:
    Jan 31, 2013
    Messages:
    722
    upload_2017-4-22_23-36-31.png
    it's a float if you want integer math.floor(X)

    if you want to be sure of your script (if the vehicle don't have an engine at some point) you can do (electrics.values.rpm or 0)
     
    • Agree Agree 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