============ Introduction ============ Legacy's Lua API is the interface for communication between Lua and Legacy mod. The basic idea for this Lua API is event-management. After a certain event, the lua-interaction-code in Legacy executes a predefined function, with additional predefined arguments. For example, if a player dies the `et_Obituary( victim, killer, meansOfDeath ) `__ function is executed. The Lua API allows you to manipulate and control this information. In some cases you can also return a value to Legacy, whenever you intercepted something (i.e. a command), and prevent Legacy to handle it further. This way, you can easily define new commands, or alter existing ones. Through special functions, it is also possible to alter Legacy's internal structures or Entities (remap shaders, manipulate client XP, set and read cvars, etc.). Implementation ============== Legacy's Lua API follows mostly the `ETPub `_ implementation with partial code of the `NoQuarter `_ implemention. The ETPub implementation being built to be compatible with `ETPro's Lua `_, all scripts written in ETPro's documentation should be valid and more or less compatible with Legacy mod's Lua API. .. important:: As Legacy uses the newer Lua 5.3, you might want to check the *Incompatibilities with the Previous Version* sections of the `Lua 5.1 `_, `Lua 5.2 `_, and `Lua 5.3 `_ manuals while porting scripts written for other mods. Standard libraries ================== The following standard Lua libraries are initialized by default and available to Legacy Lua scripts: * `basic `_ * `string `_ * `table `_ * `math `_ * `i/o `_ * `os `_ (available features vary depending on your OS)