Home - lnx00/Lmaobox-Library GitHub Wiki

Welcome to the lnxLib Wiki!

Usage

To use the library, simply download the latest release and place it in your %localappdata% folder. Then you're able to access it in your Lua scripts. Here's a snippet to do this:

---@type boolean, lnxLib
local libLoaded, lnxLib = pcall(require, "lnxLib")
assert(libLoaded, "lnxLib not found, please install it!")
assert(lnxLib.GetVersion() >= 0.965, "lnxLib version is too old, please update it!")

This included the lnxLib as the variable Lib and will make sure that the user has the correct version installed. Make sure to change the minimum version number accordingly.

It is also recommended to create local variables for the modules/namespaces you want to use:

local WPlayer = lnxLib.TF2.WPlayer
local Utils = lnxLib.Utils
local KeyHelper = Utils.KeyHelper

...or even shorter:

local WPlayer, Utils, KeyHelper = lnxLib.TF2.WPlayer, lnxLib.Utils, lnxLib.Utils.KeyHelper

Annotations

As you might have noticed, lnxLib contains detailed annotations to provide easy type and parameter checking. Make sure to install the Lua extension for VSCode as well as the Lmaobox Annotations to unleash the full potential of the annotations.

Please note that these annotations are not available in the minified release!