I want to add an lua script to play the instantAfterfireSound event upon a certain condition. The first question is how can I get an lua script to load for a car mod, the second is if it is possible to play this fmod event through lua. Thanks in advance for the help.
If you have a sound file (art/sound/yourSoundName.mp3) you'll be able to test it manually in your vlua console by running the following code (nodeID can be for example 1): Code: local sound = obj:createSFXSource("art/sound/yourSoundName.mp3", "AudioClosest3D", "", nodeID) obj:setVolume(sound, 1) obj:playSFX(sound) To make the Lua code load with your vehicle, you need to create a Lua extension. Documentation: https://documentation.beamng.com/modding/programming/extensions/ I'd suggest digging into vanilla game files, for example lua\vehicle\sounds.lua, and exploring them. From the documentation page: