Help for beginner

Discussion in 'Utilities and programming' started by ericmarciano, Nov 9, 2025 at 10:11 AM.

  1. ericmarciano

    ericmarciano
    Expand Collapse

    Joined:
    Sep 1, 2021
    Messages:
    80
    I am trying to write my first LUA script. I started with the simplest script ever :
    Code:
    local M = {}
    local function sayHello()
      print("Hello World !!")
    end
    return M
    
    It is saved into a file named "test1.lua".
    Then I open the console and try to load my script using:
    Code:
    extensions.load("test1")
    and I get this error message: extension unavailable: "test1" at location "test1"
    I tried to place this file in several locations:
    • c:\Users\<USER NAME>\AppData\Local\BeamNG\BeamNG.drive\current\lua\vehicles\extensions\ - didn't work
    • c:\Users\<USER_NAME>\AppData\Local\BeamNG\BeamNG.drive\current\mods\unpacked\MyTestMod\lua\vehicles\extensions\ - didn't work, even though the mod named "MyTestMode" appears in my mod manager
    • c:\SteamLibrary\steamapps\common\BeamNG.drive\lua\vehicle\extensions\ - it worked, but I am not very happy about putting my scripts in a game folder
    Is there a way to put my LUA scripts into a personal folder?
    Thanks for your help.
     
  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