SOLVED - How to get vehicle data in Scenario lua?

Discussion in 'Programming' started by Gh05t, Jul 25, 2016.

  1. Gh05t

    Gh05t
    Expand Collapse

    Joined:
    Jul 25, 2016
    Messages:
    25
    I've just started to learn lua and Beamng modding.
    I want to check if the headlights are On or Off in a scenario.

    Current scenario's lua snippet :
    Code:
    local function onRaceTick(raceTickTime)
            local lveh = Lua:getControlVehicle()
            if lveh == nil then print("no vehicle got") end
            lveh:queueLuaCommand("print(electrics.values['lowhighbeam'])")
    end
    
    I get the current condition of the lights in the console.

    How can I get this in a variable?:confused:
     
  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