Jump to content

[TUT]Compiling LUA files in Sublime Text 3


Neproify

Recommended Posts

Hello! Today I show you how to compile LUA files in Sublime Text 3. It's really simple. This tutorial is for Windows system.

First, you must download the luac file from: https://nightly.multitheftauto.com/files/luac_mta.exe

Now copy that to the mods/deathmatch directory in your mta server.

Next go to C:\Users\username\AppData\Roaming\Sublime Text 3\Packages\User and create file named:

mta.sublime-build 

When you do it, open file and paste text like that:

  
{ 
    "cmd": ["DEL $file_base_name.luac"], 
    "cmd": ["C:\\Program Files (x86)\\MTA San Andreas 1.4\\server\\mods\\deathmatch\\luac_mta.exe", "-o", "$file_base_name.luac", "$file_base_name.lua"], 
    "working_dir": "${file_path}", 
} 
  

Just change the directory to luac_mta.exe file if it isn't default.

Now, back to the Sublime Text 3, go to Tools->Build Systems and click on mta. Now when you build file, compiled file will be delete, next it will be compiled.

If you wanna to change the hotkey for build system just do it:

Open the .sublime-keymap based on your OS.

Enter the following:

  
[ 
    { "keys": ["f5"], "command": "build" } 
] 
  

You can change f5 to any key.

And now... You can compiling LUA files in Sublime Text 3!

  • Like 1
Link to comment

Wow this is awesome! Having to upload and download a compiled file from the webpage is really annoying. So thanks! This is very useful! :)

Just a question: With this method the files are extra-obfuscated? Or just normal compiled?

BTW: I get this warning in the console of Sublime:

WARN Without -s or -e, compiled files contains debug information and can be more easily decompiled (script.lua) 

Link to comment
  • 3 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...