SOLVED Help Issuing Vehicle Commands, not working.

Discussion in 'Programming' started by [YTGN] | Titch2000, Jul 5, 2019.

  1. [YTGN] | Titch2000

    [YTGN] | Titch2000
    Expand Collapse

    Joined:
    Jun 16, 2019
    Messages:
    57
    Hi all, so to some this might seem silly that i am asking this but end of the day the lua programming scene in beamng was new to me and i am still learning so dont hate just yet. (when i start making really silly mistakes feel free though!)

    So im trying to issue vehicle commands E.g. setting the throttle value for a vehicle. Now what i have at the moment is this:
    upload_2019-7-5_12-11-9.png

    however i am presented with this issue in console:
    upload_2019-7-5_12-12-17.png
    to make things easier for some of you, what this is saying is:
    ```attempt to index a nil value```
    Now i know that the variable command is not nil due to me printing it above the crash, and i also know that key and value arent either due to them setting values in the command variable. So the question is how does the queueLuaCommand bit work and where am i going wrong. The i variable is the number from a for loop before this is triggered, the i value is the player vehicle.

    Any help much appreciated. If anyone wants to see the full code you can get it here:
    https://github.com/Starystars67/Bea...a/ge/extensions/freeroam/multiplayer.lua#L106
    --- Post updated ---
    It needs to be done like this:
    upload_2019-7-5_14-7-3.png
     
  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