Run LUA script without freezing TPT

  • TheAwesomeMutant
    14th Oct 2017 Member 0 Permalink

    So basicly, I have this:

     

    sound.lua -

        os.execute("./sound_play.sh")

    play_sound.sh -

        play -q /home/$USER/ProgramData/PowderToy/scripts/boom.wav

     

    Now, everything is working fine, it plays the sound. The problem is, when the script is run, the console/TPT freezes up until the sound is done playing.

    How can I make it so that it doesn't freeze up?

  • jacob1
    14th Oct 2017 Developer 0 Permalink
    Try play -q /home/$USER/ProgramData/PowderToy/scripts/boom.wav &

    Otherwise it waits for the command to finish before returning execution to TPT

    no guarantees it will work, but it might
  • TheAwesomeMutant
    15th Oct 2017 Member 0 Permalink

    it works!!!

     is there a way to check when its ended?

    @jacob1

    Edited 2 times by TheAwesomeMutant. Last: 14th Oct 2017