MTA:SA Script Compiler is a Visual Studio Code extension that streamlines the compilation process for Lua scripts used in Multi Theft Auto (MTA). It uses the official Lua compilation API provided by MTA, the same one used in the Compile Lua File web page.
Parameters used in compilation:
{
compile: 1,
debug: 0,
obfuscate: 3,
}
You can install the extension directly from the VSCode Marketplace.
-
Compilation from meta.xml:
- This method will read and parse all scripts listed with type
client
orshared
, and compile all of them, creating a copy of each file, but compiled. This method also replaces the meta.xml to use the .luac version instead of the original source. That is, you will be able to keep the original source file, but as it won't be listed in meta.xml anymore, it won't be sent to the client.
- This method will read and parse all scripts listed with type
-
From Lua Script:
- This method will only compile the selected file, and won't make any changes to meta.xml, that is, you have to change meta.xml manually if needed.
- Right-click your
meta.xml
file in the Explorer. - Click the
Compile Client Scripts
button from the context menu. Check the video
from-meta.mp4
- Right-click your Lua script file in the Explorer.
- Click the
Compile Script
button from the context menu. Check the video
from-lua.mp4
This extension is open-source, and contributions are welcome. You can submit issues, pull requests, or even create your own version based on it.
GitHub Repository: brenodanyel/mta-compile-scripts
This extension does not receive or store your source files. The source files are sent directly to the MTA API for compilation. Check the source code if you want to see how it is implemented.