This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- How to extract a GMA file using Lua (does not work in Garry's Mod) | |
| -- Use forward slashes (/) like on Mac OS X and Linux, since we have to escape backslashes | |
| -- Window's directory conventions are stupid | |
| local steamFolder = "C:/Program Files (x86)/Steam/steamapps/common/GarrysMod" -- adjust for where Garry's Mod is installed, this is default | |
| extractFile(steamFolder .. "/garrysmod/addons/falldamagecustomizer_423859984.gma", "C:/Users/zachr/Desktop/extracted") -- extract one of my mods | |
| function extractFile(infile, outfolder) -- extract a gma to the specified folder | |
| local strExecute = [["cd {sf} & gmad.exe extract -file {if} -out {of}"]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Turns out, string.gsub does string replacements globally. | |
| -- For example: | |
| print(string.gsub("Hello there! You are on GitHub.", "GitHub", "Gist")) |