CompileFile
Description
Attempts to compile the given file. If successful, returns a function that can be called to perform the actual execution of the script.
Arguments
2 boolean showError = true
Decides whether or not a non-halting error should be thrown on compile failure.
This was recently added in version (2025.01.31). It might only be available on the Dev Branch right now.
Returns
Example
Assuming our file is named example.lua and located in the garrysmod/lua/ directory, the following code would execute the script.
Output: Hello!